-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] plugins #127
Comments
Another cool plugin idea: https://github.com/mafintosh/browser-sync-stream - goes esp. well with offline apps I think |
And more codesplitting stuff https://github.com/GoogleChrome/preload-webpack-plugin |
I'm sensing https://github.com/yoshuawuyts/nanostack might be a good option to add - but yeah unsure |
Can't help but have the feeling we're recreating // single input with transform
var bankai = require('bankai')
var assets = bankai('index.js')
assets.transform(purifyCss()) // optimizes CSS based on HTML, JS
var b = assets.bundle()
b.js().pipe(process.stdout)
b.css().pipe(process.stdout)
b.html().pipe(process.stdout)
// multi JS input
//
// if there's multiple files of the same type, you need to specify which stream
// you're creating
var bankai = require('bankai')
var assets = bankai(['index.js', 'outdex.js'])
assets.transform()
var b = assets.bundle()
b.js('index').pipe(process.stdout)
b.js('outdex').pipe(process.stdout)
b.js('common').pipe(process.stdout)
b.css().pipe(process.stdout)
b.html().pipe(process.stdout)
// render JS to HTML
// is a plugin b/c it needs to change single HTML file to multiple HTML files.
// We wanna copy the labeled-stream-splicer approach browserify has (TBI, lots
// of details here)
var bankai = require('bankai')
var assets = bankai('index.js')
assets.plugin(renderHTMLOnServerSomehow())
var b = assets.bundle()
b.js().pipe(process.stdout)
b.css().pipe(process.stdout)
b.html('/').pipe(process.stdout)
b.html('/mainView').pipe(process.stdout)
b.html('/:otherView').pipe(process.stdout)
b.html('/:and/:another/:one').pipe(process.stdout) |
What is the purpose behind |
@Karissa it's to select one of many files - in this case |
to summarize from irc: i'm not sure bankai needs a plugin system. Sometimes bloat on a developer tool is OK since it takes away the paralysis of choice (eg: standard, tap). Install size is partially irrelevant (or you wouldn't use it, or you can install it globally), and if you aren't using something that comes with it, you're not increasing my cognitive load for using the product (again, tap comes with a TON of shit I couldn't care less about but I don't really care...) |
very good point - closing for now! |
Was thinking of some stuff I'd like bankai to do, and then realized it might get too bloaty. Instead having a plugin system might perhaps help. Is it great? Nah. But it's probably the lesser of a bunch of evils.
I think we could probably learn from
browserify
's plugin architecture because it's super solid. I don't think transforms make a lot of sense for us here because it could refer to either JS, CSS or HTML which already have specific transforms available (html not so much, but yeah).I was thinking in
package.json
people could do something like:Or from the CLI:
plugin examples
choo
router to static htmltodo
cc/ @toddself @kristoferjoseph think this might be of interest for y'all; input would be v welcome!
The text was updated successfully, but these errors were encountered: