-
Notifications
You must be signed in to change notification settings - Fork 842
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
A clean, full ES6 version of EJS, without changing the codebase #656
Comments
If you want to go with (2), I will be happy to make a PR which will add the build step for the ES modules version. Just let me know. |
I'm on vacation with the family this week, but I'll take a look at this as soon as I can. I really appreciate all the work you have put into this. |
No stress at all. I am glad I could help. |
This would be incredibly useful, and I second @mercmobily about option 2. I'm not a Rollup expert but the integration should be fairly painless. Plus it seems that's the direction where others too are moving towards. For example (and hopefully this could help @mde in the integration, by providing yet another example) Marked seems to do the same, as you can see the |
@mde Matthew, first of all please allow me to re-iterate how much I appreciate you maintaining EJS. Thank you! |
@mercmobily Whats the current status of your fork, still looking good? Does this enable me to do |
I am using https://github.com/mobily-enterprises/ejs4b in production with no issues so far. I am using EJS as of 8 months ago -- I won't upgrade in case things go bad. I am still hoping @mde will give his OK for a PR, and go from there. |
Please note that mine is NOT a fork. I take the exact same EJS, and just "repackage" it so that it's an EJS! |
It took me a while, but I got there.
I am not submitting a PR because I am still working out kinks, and I would like to talk to you about how to go about it.
The short version: I did it! Have a look here: https://github.com/mobily-enterprises/ejs4b
It converts ejs into ES6 modules. Please note that it DOESN'T minify/etc. the only real changes there are in the fact that some of Node's calls are stubbed. Basically Rollup is doing what Browserify does. I can't say whether it does it "better" or not, but I can tell you they put a lot of work into this.
So... options:
(1) The non-committal way
We keep this as a separate repo. I will set up some kind of hook so that the version us updated automatically (I hate it when things like this stop working after 2, 3 years). Ideally, you'd put a link
(2) The integration way
You can easily take my rollup.config.js and simply add it to your repository. I would call the end result
ejs-es.js
.So, you will have 3 files: /lib/ejs.js (node, unminified), /ejs.js (browser, unminified), /ejs-min.js (browser, minified) and the NEW /ejs-es.js (browser, unminified, ES6). The naming makes sense. Also, please note that there is no point in minifying the ES version, since it's meant to be built/included using tooling.
I think people would be happier if you went for (2). However, it depends on you. Please have a look at my repo (which is totally minimal) and let me know which way you want to go.
Thank you!
The text was updated successfully, but these errors were encountered: