p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

feat: configure webpack-dev-server for independent frontend development

Open hydrosquall opened this issue 3 years ago • 2 comments

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 + upgraded webpack-cli
  • Created a pair of lodash.template templates index.html and preview.html for the two primary routes needed for the app's functionality. Populates with the environment variables through the same dotenv 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 onto develop then too)
  • [x] is descriptively named and links to an issue number, i.e. Fixes #123

hydrosquall avatar Feb 11 '22 04:02 hydrosquall

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-com[bot] avatar Feb 11 '22 04:02 release-com[bot]

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).

hydrosquall avatar Feb 15 '22 02:02 hydrosquall

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!

raclim avatar Apr 19 '23 18:04 raclim