Skip to content

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

Closed
hydrosquall wants to merge 7 commits into
processing:developfrom
hydrosquall:cameron.yick/experiment/webpack-dev-server
Closed

hydrosquall wants to merge 7 commits into
processing:developfrom
hydrosquall:cameron.yick/experiment/webpack-dev-server

Conversation

@hydrosquall

@hydrosquall hydrosquall commented Feb 11, 2022 •

Copy link
Copy Markdown

Motivation

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

  • has no linting errors (npm run lint)
  • 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)
  • is descriptively named and links to an issue number, i.e. Fixes #123

@release-com

release-com Bot commented Feb 11, 2022

Copy link
Copy Markdown

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

Comment thread .node-version
@@ -0,0 +1 @@
12.16.1

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on #1308

screen,
within
} from './test-utils';
import { reduxRender, act, waitFor, screen, within } from './test-utils';

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint requested the removal of fireEvent

Comment thread package.json
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^4.2.3",
"webpack-cli": "^4.4.0",
"webpack-cli": "^4.9.2",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped this version because of symfony/webpack-encore#1069 (comment) .

Comment thread public/index.html
window.process.env = {};
}

window.process.env.API_URL = '<%= htmlWebpackPlugin.options.API_URL %>';

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax for variable interpolation comes from https://lodash.com/docs/4.17.15#template . Using other templating languages (ejs, handelbars, etc) would have required installing another loader.

@hydrosquall

Copy link
Copy Markdown
Author

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

@raclim

raclim commented Apr 19, 2023

Copy link
Copy Markdown
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants