-
Notifications
You must be signed in to change notification settings - Fork 881
refactor: Migrate from Next.js to pure webpack config #360
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #360 +/- ##
==========================================
+ Coverage 68.23% 68.27% +0.03%
==========================================
Files 160 159 -1
Lines 9256 9226 -30
Branches 76 73 -3
==========================================
- Hits 6316 6299 -17
+ Misses 2320 2307 -13
Partials 620 620
Continue to review full report at Codecov.
|
I'm very excited for this change! Seems like it'll improve the dev experience significantly! |
This brings an initial E2E test (really, an integration test - it's only running the server locally, as opposed to against a deployment - but it'd be easy to point playwright to a deployment). Demo gif:  This test exercises a minimal flow for login: - Run the `coderd` binary to start a server on 3000 - Create an initial user as part of setup - Go through the login flow and verify we land on the projects page It will be useful to have to ensure that #360 doesn't introduce a regression in the login flow Future E2E tests that would be useful: - Create a project & verify it shows in the UI - Create a workspace and verify it shows in the UI
Co-authored-by: G r e y <[email protected]>
Co-authored-by: G r e y <[email protected]>
Seems like this is (finally) ready to merge! I'll bring it in so that I can vet it over the next week (and also as a canary for the v1 version of this change) |
@bryphe-coder congrats on merging in this change! |
Fix for #348 - migrate our NextJS project to a pure webpack project w/ a single bundle
next/link
toreact-router-dom
's linknext/router
toreact-router-dom
's paradigms (useNavigation
,useLocation
, anduseParams
)react-router-dom
webpack-*
dependencies and removenext
dependenciesnextrouter
package, use simpler routing strategyelement
html_templates
folderMain.tsx
as entry point_document.tsx
to a static solutionCSP
nonces) get populated correctlywebpack-bundle-analyzer
to check bundle is correctwebpack-dev-server
package.json
dependenciesembed
strategy be used? If so, safer to use that than roll a new implementation 🤔I've hooked up a

build:analyze
command that spins up a server to show the bundle size:The bundle looks OK, but there are some opportunities for improvement - the heavy-weight dependencies, like React, ReactDOM, Material-UI, and lodash could be brought in via a CDN: https://stackoverflow.com/questions/50645796/how-to-import-reactjs-material-ui-using-a-cdn-through-webpacks-externals
I'll defer this to a separate issue, but once those are extracted - the bundle should be fast and lean. Using the CDN for those dependencies is great for performance, because usually users will already have the libraries cached, and they are downloaded in parallel to our bundle.