-
-
Notifications
You must be signed in to change notification settings - Fork 760
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
[Suggestion]: Adding webpack to allow ES201* JavaScript #202
Comments
👍 |
I love you 😂 |
What are steps that we can do here? How can I help? |
...just to make sure: I wasn't disappointed by the simple 👍🏾 or anything just enjoyed the simplicity of it. Draft of steps would be
Something we could try along the way as a final step is to remove the dist files from the repo. We could add them right before the Makes sense? |
From my side no objections. However, let's hear what the other core contributers have to say: @neilj and @fhemberger - any objections? |
...wondering if they have any objections |
Seems fine to me. I'm curious in how far the size of the dist js may differ afterwards. |
In general this seems fine. My main concern would be whether you include the final build file in the repo or not. In general, you don't want to store build products in version control (for a start, you have to remember to keep it in sync), but if you don't then every user now has to be able to set up the build environment in order to use it, whereas at the moment they can just clone the repo and copy over the single file they need. So I'd probably advocate for including the single ES5 file version still in the repo. |
@neilj totally agreed. The distribution files do not belong into the repo. With keeping the end user in mind this might be troublesome for him though. However, I think I failed to point out how to circumvent the problem:
Combing both I think we would end up at a sweet spot for both sides. |
Me too, This is critically important. |
Hi all, any news here? This has been stale for a while. |
Sorry for letting it stale. I didn't have time taking this further but will as soon as possible. The main issue is still that we use the This all relates to #206. |
Same here no worries :D |
@tdeekens, to support ES6, could I suggest using Rollup instead of Webpack? Webpack adds a lot of boiler plate code, and is better suited to assemble web apps where code splitting is crucial for load performance. That is not required to build a library, and Rollup will assemble code into a more integrated and run-time efficient unit. The mantra is: Use webpack for apps, and Rollup for libraries.
https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c |
I agree with the article and general mantra. I however don't feel adding webpack or rollup is the bulk of the work in this case. If you follow the PR on the matter it's also replacing jshint with eslint, while adding prettier as a config base and formatter, migrating a bit of library code while most importantly replacing the UMD closure reliance of the library. I am happy to play and evaluate rollup vs. webpack as a tool in the end. |
Alright, @jfparadis the updated bundling process in #206 uses |
Background & Context
Currently DOMPurity does not have a built tool in place. This is nice and often simplifies things. However, adding webpack might give the project some benefits and this issue is about to align on the potential gain of it.
Feature
Adding webpack would yield the following benefits
src/purify.js
Adding webpack might have the following disadvantages
What do you all think? Might this be worth to at least spin up a PR for and discuss progress along the way or is it something DOMPurify does not really need? I would be able to drive the change...
The text was updated successfully, but these errors were encountered: