Open KyleAMathews opened 10 years ago
There are a couple issues, though neither is insurmountable.
klass
out and only add it as a dependency in package.json. I could of course leave things the way they are, but would prefer a nice way to migrate existing users.i did some preliminary npm-ification work at https://github.com/leeoniya/reMarked.js/tree/npm-package
i guess one way could be to include a copy klass.js
in the repo and do something like importScripts() (à la Web Workers) if a klass
is not detected.
i think i've fixed 1) in https://github.com/leeoniya/reMarked.js/commit/1c852c2749877329909fd54c0f6e3a4a8a3e1827
I think you can do like this
https://github.com/haohcraft/reMarked.js/compare/npm-package
i wanted to avoid a dependency on require
itself, which more than doubles the necessary download size. http://requirejs.org/docs/release/2.1.13/minified/require.js
I see.
But I use the webpack (https://github.com/webpack/webpack), so the "require" is not actually require.js but "requiring" the module.
You're using klass
once. Would a PR that simply replaces that call with equivalent prototype-mangling code be welcome?
@marijnh sure, i'm not married to klass
, but i do use its supr
methods as well as the prototype chain instanceof
testing. it's also really small. if you have something in mind that'll work instead that doesnt involve bloating the code with Object.create
and .prototype
madness at every .extend()
and supr()
, i would not be opposed to swapping it out.
to note, breaking klass
out as a dependency would require all instances of init:
to be changed to initialize:
- i wasn't too fond of the supr
being oddly shortened and initialize
being long.
that being said, i can also just leave it the way it is and call it a day.
I'd love to use this in a current node.js project. Looks much nicer than the few other similar modules that are available.