Skip to content
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

feat(dev): HMR + Hot Data Revalidation #5259

Merged
merged 67 commits into from
Feb 22, 2023
Merged
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
df0d4a0
wip
pcattori Jan 25, 2023
6a9a5ff
wip
pcattori Jan 25, 2023
44c1fbb
wip
pcattori Jan 25, 2023
2c2b322
IT LIVES
jacob-ebey Jan 25, 2023
5b31a3e
revert port
jacob-ebey Jan 25, 2023
fd5bd1d
Updated to completely strip server methods from route modules instead…
jacob-ebey Jan 26, 2023
cbccdcf
- remove logs
jacob-ebey Jan 26, 2023
f3d4992
- added a few comments
jacob-ebey Jan 26, 2023
29c20f3
consistent timestamps for entry and routes
pcattori Jan 26, 2023
0430bec
wip
pcattori Jan 26, 2023
56df876
smart hmr: live reload when server needs it, otherwise hmr
pcattori Jan 26, 2023
5cb03a4
CSS HMR ✅
jacob-ebey Jan 28, 2023
78ea28d
update in better location to avoid race conditions
jacob-ebey Jan 28, 2023
faa371c
comment things a bit
jacob-ebey Jan 28, 2023
22fc2c9
more comments
jacob-ebey Jan 28, 2023
e01b9e5
always HMR, full reloads are no longer needed
jacob-ebey Jan 28, 2023
cf7ec3f
detect loader changes for router self-revalidation
pcattori Feb 2, 2023
628062b
refactor: compiler returns assets manifest and metafiles for browser/…
pcattori Feb 4, 2023
de9e5cd
refactor: basing hmr updates off of assets manifest routes
pcattori Feb 6, 2023
e9d81ff
fix: update react scripts component to use `hmr.runtime`
pcattori Feb 7, 2023
8ba7b32
refactor: manifest timestamp
pcattori Feb 7, 2023
6d858bd
fix: prevent duplicate chunks caused by untimestamped imports
pcattori Feb 8, 2023
54b26e9
feat: log hmr updates including reason and if revalidating
pcattori Feb 8, 2023
6f1770b
refactor: hmr messages
pcattori Feb 9, 2023
54b4476
fix: do not preload route chunk if hmr already loaded it
pcattori Feb 9, 2023
1dc778a
refactor(dev): update react-router api call for hmr
pcattori Feb 9, 2023
9f2cb05
refactor: manually revalidate until we have more granular apis
pcattori Feb 9, 2023
bf296b7
fix(dev): only do hmr for unstable_dev
pcattori Feb 9, 2023
5449aa0
fix(dev): dynamic, configurable unstable_dev port
pcattori Feb 9, 2023
a5acb65
fix(dev): only apply hmr for browser routes in dev mode
pcattori Feb 10, 2023
a0a7643
wip: test
pcattori Feb 11, 2023
ddeeeda
fix: detect `loader` changes when using variable expressions
pcattori Feb 13, 2023
5fdd600
fix: chunk hmr runtime separately
pcattori Feb 13, 2023
c0d7483
wip: updated typescript so that transforms work in tests
pcattori Feb 13, 2023
421df1f
fix: hash hmr routes as part of assets manifest version
pcattori Feb 13, 2023
5bfef5d
chore: update entry to more simply support refresh
jacob-ebey Feb 14, 2023
d84e68f
add abort controller for subsequent HMR updates before completion
jacob-ebey Feb 14, 2023
e926d17
test(dev): dynamic ports for hmr integration test
pcattori Feb 15, 2023
35b4fec
fix: hmr caused subsequent navigations to fail
jacob-ebey Feb 15, 2023
98f1062
remove comment
jacob-ebey Feb 15, 2023
98a44c0
revert module changes in favor of updating cache early and in place
jacob-ebey Feb 15, 2023
026b1c4
strip `import.meta` from cjs builds
jacob-ebey Feb 16, 2023
a74aee4
test(dev): `import.meta` support for jest
pcattori Feb 16, 2023
764731f
fix(server-runtime): fix typechecking
pcattori Feb 16, 2023
5974015
style(dev): indentation
pcattori Feb 17, 2023
4b87d03
test(dev): reference local remix dev cli
pcattori Feb 17, 2023
d2b2d14
fix(dev): only send hmr updates for files that changed
pcattori Feb 17, 2023
69bc58f
refactor(dev): list of isolated chunks for hmr
pcattori Feb 17, 2023
b2bcad9
wip: esbuild loaders for browser route mods
pcattori Feb 17, 2023
f3ede9e
refactor(dev): extract transform utils from `codemod/`
pcattori Feb 15, 2023
5cc7ea1
refactor(dev): remove server-only exports via babel ast transforms
pcattori Feb 15, 2023
8c057a2
chore(dev): remove unused dependency
pcattori Feb 17, 2023
1ce71c2
fix(dev): transform jsx
pcattori Feb 17, 2023
acd3894
fix(dev): mdx browser routes
pcattori Feb 17, 2023
1832413
chore: update yarn.lock
pcattori Feb 17, 2023
686a6e9
chore(react): set `preventAssignment` to silence warning
pcattori Feb 17, 2023
24a9587
chore: add changset for hmr
pcattori Feb 17, 2023
0ec995c
update router to experimental
jacob-ebey Feb 17, 2023
de5f190
chore: depend on pre-releases instead of experimentals
pcattori Feb 21, 2023
491726f
test(dev): increase timeouts for hmr test
pcattori Feb 21, 2023
3366bc9
test(dev): increase timeout for windows ci
pcattori Feb 21, 2023
939a30c
test(dev): increase timeout to 1m for windows ci
pcattori Feb 22, 2023
14e8110
test(dev): increase timeout to 2m for windows ci
pcattori Feb 22, 2023
ac53b8b
Merge branch 'dev' into pedro/hmr-adventures
pcattori Feb 22, 2023
8f60539
test(dev): fail immediately when stderr is written to
pcattori Feb 22, 2023
7068fae
test(dev): `cross-env` for `NODE_ENV` on windows
pcattori Feb 22, 2023
3121ea6
test(dev): revert timeout for windows ci
pcattori Feb 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(dev): cross-env for NODE_ENV on windows
pcattori committed Feb 22, 2023
commit 7068faec63f5a5e0acf74bd733ae3d01bb61f3fe
5 changes: 3 additions & 2 deletions integration/hmr-test.ts
Original file line number Diff line number Diff line change
@@ -21,12 +21,13 @@ let fixture = (options: { port: number; appServerPort: number }) => ({
"private": true,
"sideEffects": false,
"scripts": {
"dev:remix": "NODE_ENV=development node ./node_modules/@remix-run/dev/dist/cli.js dev",
"dev:app": "NODE_ENV=development nodemon --watch build/ ./server.js"
"dev:remix": "cross-env NODE_ENV=development node ./node_modules/@remix-run/dev/dist/cli.js dev",
"dev:app": "cross-env NODE_ENV=development nodemon --watch build/ ./server.js"
},
"dependencies": {
"@remix-run/node": "0.0.0-local-version",
"@remix-run/react": "0.0.0-local-version",
"cross-env": "0.0.0-local-version",
"express": "0.0.0-local-version",
"isbot": "0.0.0-local-version",
"nodemon": "0.0.0-local-version",
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -95,6 +95,7 @@
"chalk": "^4.1.2",
"cheerio": "^1.0.0-rc.3",
"concurrently": "^7.0.0",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"cypress": "^9.6.0",
"eslint": "^8.23.1",
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
@@ -4957,6 +4957,13 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=

cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz"
@@ -4977,7 +4984,7 @@ cross-spawn@^6.0.5:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==