-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
use Parcel for build process #3431
Conversation
@limzykenneth what do you think? |
This is definitely a lot better than the rollup concept, just one new package and the build file is so much cleaner. Also the tests are able to pass at least in the browser that's also extra points! Passing tests in command line is more complicated probably because of spawning a Chrome instance to run the test, it will be great to have that pass somehow. I personally much prefer this to the rollup one just because of its straightforwardness and simplicity. |
ab50600
to
4d423df
Compare
@limzykenneth i think this is ready now!! would you mind taking another look and let me know what you think? |
Amazing! I'll take a look soon, will get back to you. |
Looking great so far! Couple things from me, first is that do we need to generate source maps? I'm thinking probably not as they need to be included by the users or it would throw 404 errors which can be confusing for beginners and inlining the source map will bloat out the already pretty big full version of p5.js. If I understand correctly Another detail, does the build step needs to be separate out into two? ( Is it a stylistic choice for clarity or does separating the steps have some functional purpose? Again, no major opinion about this, just curious. |
i noticed that while es6 code in p5.js is transpiled into es5 (eg. the |
@limzykenneth thanks, these are all good points!
that's a good call. i'll disable those :)
yep!
it was easier to reuse some logic/config, but i'm happy to make it into one step. that probably makes more sense since we don't really do one without the other, right?
@Spongman that's a really good catch, thank you. i'm looking into this now and will report back soon. until this is resolved we can't move forward with parcel here. |
Thanks @outofambit this is looking great! I agree with @limzykenneth that it makes sense to combine |
I don’t think we can use parcel: parcel-bundler/parcel#13 |
Yeah, @Spongman i think you are right, and thank you again for catching this. There are open issues for this in parcel (parcel-bundler/parcel#1655, parcel-bundler/parcel#2500), but there has been little movement on them. Weirdly, the parcel docs state "Parcel transpiles your code with @babel/preset-env by default, this is to transpile every module both internal (local requires) and external (node_modules) to match the defined target." (I'll probably open a PR to change that so others don't end up in this situation, too.) Unfortunately, I think this means we're going to have pass on parcel. I've tried a number of workarounds, but none have worked. Apologies to all involved that this didn't pan out. 😞 |
that's a real shame. if it wasn't for this, it seems like this would have been a good solution. |
Just ran into this too. It's a real pity that (imo) makes parcel essentially unusable. What's the point of transpiling the top of the iceberg when all the rest is going to break in many users' browsers? |
for #3425. definitely seems more straightforward than configuring rollup (#3429)
Goals
parcel
uglify
dependencyremove(browserify
dependencycombineModules
task needsbrowserify
for now)Implementation Details
parcel
andparcel:min
grunt
tasks that replacebrowserify
taskp5.dom
minification task, but moved fromugify
toterser
(whichparcel
uses internally)parcel
. it will continue to usebrowserify
for nowprocess.env
) to set minification in bundle at build timegrunt-banner
dependency to add comment banners to outputted builds (parcel
does not yet have good support for this, and it can be used acrossp5
andp5.dom
building)To Do
Left to do for this to be considered for merging:
data.json
exclusion(add banner option for bundler and use in core packagers parcel-bundler/parcel#2666)