processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.37k stars 1.32k forks source link

[dev-task] Separate Webpack Dev server from API server #1348

Open hydrosquall opened 4 years ago

hydrosquall commented 4 years ago

Nature of issue?

Feature enhancement details:

New feature details:

Perhaps a good way forward is separating the webpack dev server from the API server so that the can be run standalone? Then we could also switch to Parcel if we wanted.

andrewn commented 4 years ago

@hydrosquall I started thinking about how we might do this and ended up with a branch that mostly does it...

The general idea is:

The missing piece is being able to contact the deployed API. At the moment we restrict CORS origins to only p5js.org. I've opened PR #1398 to address this.

To run the client only, you npm run start:client and to run both npm start.

Once we have this separation, then we can start experimenting with other packagers.

What do you think?

hydrosquall commented 4 years ago

Hi @andrewn, I think that sounds like a clean approach, as long as there aren't any particular security motivations to keep the CORS restrictions. I think this should be fine especially if someone just wants to be running the site in a "stateless" mode.