-
-
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
Refactor and clean up build configurations #5792
Conversation
New release process that only uses github actions is also included now. Relevant documentation will be written later. Will work on the following still, with some as informed by #5971:
|
Remove grunt-babel and globally transform node_modules using babelify.
For the latest updates, Uglify has been updated to the latest version and so it support ES6+ syntax now.
ESLint dependency on prettier has been removed with a set of new rules that matches existing behaviour subbed in, with minor modifications. To remove prettier entirely is more difficult and ESLint doesn't seem to fix the compiled p5.js file as intended. More investigation into this is ongoing but I may call it at some point to go back to contributors documentation. |
Replace prettier with pretty-fast in build generation. Remove unreliable babel configuration.
Prettier has been successfully removed, although not with ESLint fix as that is as slow if not slower than prettier, but with pretty-fast which is the code formatter used by Firefox's console debugger. Formatting the final output of the code base is now at least 3 times faster. The build overall should be a few seconds faster but will likely still take about 10 seconds to finish one version (with 3 versions in total, each taking different amount of time). To further optimize, we can consider replacing Babel with SWC, which I'm using in my own projects and is significantly faster, although with the plugins we are using it will be difficult to make that switch. In any case, this PR is ready for review. @davepagurek @dhowe @endurance21 @jesi-rgb Do have a look if you are able to. |
Great, @limzykenneth! I'll review it as soon as I can :) |
The explanation is awesome ! I would like to appreciate the amount of work and intelligence put here. I have a basic doubt here, if we are transforming Does that also means that those "fs" calls will still be present after bundling ? |
This is how the bundling currently works with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! I tried a local build and it all works as expected. Thanks for taking this on!
Thank you all! 🚀 |
(I'm not sure if this is the right place to bring this up, but this is the issue thread for the commit in question) When trying to clone/fork/build p5.js on my Windows dev environment, I ran into this eslint error from the I noticed that in commit eef4ce6 that was merged from this issue, the I'm not sure if enforcing |
@josephmwells Enforcing LF line endings is intended and we had issues before where git config
|
@limzykenneth Yah that makes sense, I tend to default to LF line endings across my dev environments since I am often switching between Windows and Unix. From what I've gathered crawling through old issues and commits, there was a very opinionated maintainer who felt that I'm currently just conducting some tests on the p5.js source right now, so it's not a huge blocker for me, but it would be nice if there was some remedy to this that specified the LF line endings opinion in code, and having that documented somewhere since a lot of Windows developers have |
@josephmwells Would you like to open a new issue to discuss this in more detail. We can include more contributors that way as a closed PR is not very visible. |
Resolves #5791
Changes:
Clean up and refactor code relating to the build and release process. Some changes will likely happen on the website repo as well. Main discussions on #5791.
PR Checklist
npm run lint
passes