-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Experimental] Standalone Frontend Dev Server #1257
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
[Experimental] Standalone Frontend Dev Server #1257
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. |
50ddfe7
to
b16d3bc
Compare
Thanks for working on this! Question about using Parcel—is it weird to have both Webpack and Parcel in a project? Does this circumvent Webpack? |
If we like Parcel enough, it could replace webpack- I just didn’t want to
prematurely remove it. In either case, both bundlers were reading from the
same .babelrc, hence the changes to that file.
If there are custom things that we need our webpack to do, then switching
over may not make sense. If everything is covered by parcel’s defaults, we
would hopefully have a smaller build related maintenance burden over time
(see
https://flaviocopes.com/parcel/ )
…On Tue, Feb 25, 2020 at 4:04 PM Cassie Tarakajian ***@***.***> wrote:
Thanks for working on this! Question about using Parcel—is it weird to
have both Webpack and Parcel in a project? Does this circumvent Webpack?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1257?email_source=notifications&email_token=ACE2MM3Z6ZV4C24ZXPAUC7TREWBVFA5CNFSM4KUJSMYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM5PZBA#issuecomment-591068292>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACE2MM3CE6N4GSS77RCDVK3REWBVFANCNFSM4KUJSMYA>
.
|
b16d3bc
to
9131f9c
Compare
9131f9c
to
9b5724d
Compare
I agree that not having to run the API and mongodb to make front-end changes would be great! I think we should use the same packager and config for all development environments. This will ensure making a change in the front-end-only env will be the same as the full-stack env and avoid weird bugs with the different packagers. 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. |
Thanks @hydrosquall! I would be down to explore if it makes sense to move from webpack to parcel. There's really nothing fancy happening with the bundling in this app, and maybe parcel is good enough. |
I took a look another at trying with the latest Parcel 2 and the latest head of I ran into a few hurdles due to changes to both this codebase and Parcel itself, some of which seemed time effective to solve, others which do not.
p5.js-web-editor/webpack/config.prod.js Lines 119 to 140 in f373938
I look at the code that actually reads these SVGs. It didn't seem worthwhile to rewrite this code such that all SVGs are loaded in 1 way, since there seemed to be legitimate reasons to be loading icons in 3 different ways in the editor for now. I didn't have confidence that this would be the end of Parcel configuration issues (inability to load relative URLs looked problematic too parcel-bundler/parcel#206 ), so I think may be best to retire the idea of using Parcel 2 to bundle this project, given that the current webpack config has a few customized asset loaders. It might be more practical to get the standard webpack dev server working instead, so I'm going to try that in a separate PR. References
|
Closing this PR as it will be replaced by #1999 . |
Motivation
This is an experiment to to make it easier for people to contribute to the frontend by reducing the amount of setup steps (no mongodb) if they're making a frontend-only change. If we like the dev experience, it might be worthwhile to extract the "client" portion of the app to its own package, which the "server" can import.
Changes
process
based on the simplified definition ofindex.html
(I didn't bind the process variables to the window).12.16.0
locally since I usenodenv
rather thannvm
, and12.16.1
wasn't available. However, hopefully there shouldn't be significant differences.Testing
npm run parcel
cp .env.example .env
1234
.A live version of this app was auto-deployed to
now.sh
at this url:(Login and other stateful features are disabled, since I didn't supply any environment variables. However, if supplied locally, those should work too. The API_URL will probably not work out-of-the-box, since it looks like CORS is disabled with the production API.
The now Github integration is capable of automatically building branch previews every time someone opens a PR, but I manually supplied the link here since this is still early-stage.