We've decided to make riot.route optional. #1322
I'm guessing what's the best way...
It could be like this:
Another option is loading separately:
But it feels bit inconsistent.
Should we separate compiler, too?
Any thoughts? Thanks!
BTW, for Browserify and WebPack, it'll be more simpler:
var riot = require('riot')
riot.route = require('riot-route')
riot = require('riot')
route = require('riot-route')
@cognitom , please B. I just was thinking about the parsers.
I think we must remove all the parsers and release riot with a subfolder with these and other optional "core" components, like the router, the compiler, maybe an alternate styleManager, and so on (custom tmpl for precompiled expressions).
Example: Include a pre-made default version of riot for browsers only --i.e. unminified, no compiler/commonjs/router.
Then, with an included tool the user can make a custom version of riot, like underscore or zepto already does:
mkriot --compiler --router --parser babel -o js/riot
just an idea.
I already do something like this with the compiler using jspreproc. This allows me to generate optimized versions for the CLI and riot with the same code base.
Optional route! YAY.
I use browserify so I don't care how you separate them, but I'm excited for this!
Thanks for your feedbacks, guys!
@aMarCruz ok, let's go with B.
I think this topic is really important because it will affect the rollup build, I will do some tests guys in the rollup branch and I will let you know the simplest solution
B' appeals to me - I don't know of any advantage for them being all in the same file.
But like jpodwys, I use Browserify, so all I really care about is you pulling the trigger on some method and publishing a smaller module to npm!
Agree with @TehShrike as B' seems more appealing. This helps in separating scopes and making Riot more flexible and modular.
And everyone uses task-runners and/or module-loaders nowadays anyways, all those independent files could easily be concatenated or loaded on demand in production. No big deal on performance topic.