p5.js-web-editor
p5.js-web-editor copied to clipboard
feat: configure webpack-dev-server for independent frontend development
Motivation
- Enable people to contribute to
p5.js-web-editor
without needing to run a full node server + database - Fixes #1348
- A redo of #1257 , given that Parcel doesn't support the range of customizations needed by the web editor. See here for a full breakdown of why I let go of Parcel.
Changes
- Added
webpack-dev-server
dependency + upgradedwebpack-cli
- Created a pair of
lodash.template
templatesindex.html
andpreview.html
for the two primary routes needed for the app's functionality. Populates with the environment variables through the samedotenv
configuration path as the server. Omits some of the variables that seemed unrelated to frontend development. - Updated documentation for how to use the new dev server
- Manually verified screenshot: https://a.cl.ly/L1uWEq1l
Testing
Try running this locally:
npm run start:frontend-server
Checklist
- [x] has no linting errors (
npm run lint
) - [x] is from a uniquely-named feature branch and has been rebased on top of the latest
develop
branch. (If I was asked to make more changes, I have made sure to rebase ontodevelop
then too) - [x] is descriptively named and links to an issue number, i.e.
Fixes #123
Release Environments
This pull request environment is provided by Release, learn more! To see the status of the environment click on Environment Status below.
:wrench:Environment Status : https://app.releasehub.com/public/Processing%20Foundation/env-95c3decd04
Release Environments
This pull request environment is provided by Release, learn more! To see the status of the environment click on Environment Status below.
🔧Environment Status : https://app.releasehub.com/public/Processing%20Foundation/env-95c3decd04
@catarak which port does the preview app usually run on? It looks like 8080
and 5000
don't seem to be it. (The change I made shouldn't be picked up since I didn't change the existing build step, I just wanted to make sure that changing webpack-cli's version didn't break anything surprising).
Thank you so much for all of your efforts and for taking the time to contribute to this issue—I'm so sorry we couldn't get to your work in time! Since some time has passed I'm going to close this for now, but please feel free to reopen this or work on this again, thanks!