Closed crabmusket closed 9 years ago
Byte counting.
Not sure if serious. I think having SVG available is pretty important. I've been bitten before by trying to require virtual-hyperscript myself and then running into a version mismatch.
IMO it doesn't belong in core. To me, the core should be the minimal subset of modules an app needs to get up and running -leave the rest for the user to require manually.
This is the only real alternative I've found:
var svg = require('mercury/node_modules/virtual-dom/virtual-hyperscript/svg');
Or watching the version of virtual-dom in mercury and keeping a separately installed copy of virtual-dom up to date, which I didn't want to have to do.
I definitely understand the rationale behind a small core, but taken to the logical extreme none of the state modules would belong in it. I feel this addition is acceptable in the spirit of the other things that are in the core.
@eightyeight it was removed to keep a small core.
If your using mercury in production I recommend you just copy mercury/index.js
into your app and pull in all the dependencies one for one.
This allows you to customize it to your need; like adding svg.
@Raynos: meet you in the middle: can we export SVG as h.svg
? That would be a change in virtual-dom/virtual-hyperscript
, not in this repo, but what do you think of the idea?
@eightyeight why dont you just import it yourself? why does it need to be a part of those modules?
var svg = require('virtual-dom/virtual-hyperscript/svg');
Because that requires that I depend on virtual-dom directly, and that I therefore have to keep the version up to date with the version mercury uses. You know, it's not the end of the world, but I thought exporting SVG from mercury wouldn't be the end of the world either haha.
@eightyeight I do reccomend taking @Raynos's suggestion of making a mercury.js file from mercury's index.js and sort of subsuming this repo into your front end. maybe mercury would be better as a yeoman template? hmm people have strong feelings about yeoman
We can add a top level svg.js
so you can do require('mercury/svg')
@Raynos that works for me, if you're happy with it! @kumavis I guess that does make some sense.
Because why not?