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(gatsby): lazy bundle page components in dev server #27884

Merged
merged 36 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b78ee23
feat(gatsby): lazy compile page components in dev server
KyleAMathews Nov 6, 2020
636afaf
Fix lint
KyleAMathews Nov 6, 2020
b46f680
Cleanup logs
KyleAMathews Nov 6, 2020
a47442e
cleanups
KyleAMathews Nov 6, 2020
a378040
fix tests
KyleAMathews Nov 6, 2020
a268a4d
Don't bother with navigating — if webpack doesn't update — the user p…
KyleAMathews Nov 6, 2020
4d07210
Update packages/gatsby/src/bootstrap/requires-writer.ts
KyleAMathews Nov 9, 2020
59a0385
Update packages/gatsby/cache-dir/dev-loader.js
KyleAMathews Nov 9, 2020
1cef9c0
Fix lint error
KyleAMathews Nov 9, 2020
56d5288
Wait until we know staticQueryHashes are written to page-data.json files
KyleAMathews Nov 10, 2020
29db87e
Disable check in production
KyleAMathews Nov 10, 2020
afc77cc
Only trigger compilation/page writing once
KyleAMathews Nov 10, 2020
237d715
Also pull xhr loaded static queries for <StaticQuery>
KyleAMathews Nov 10, 2020
d23f5fb
Merge branch 'master' into devjs-lazy
KyleAMathews Nov 10, 2020
f87a58c
instance isn't defined in builds apparently
KyleAMathews Nov 11, 2020
208cedf
Work around webpack hot reloading bug
KyleAMathews Nov 11, 2020
94aa19f
For static queries, data pushed from websocket is the most fresh
KyleAMathews Nov 11, 2020
902cf62
Centralize logic and prevent it from repeatedly hitting the backend
KyleAMathews Nov 12, 2020
4bca292
fix ordering of merge
KyleAMathews Nov 12, 2020
36738e3
Comment and add timeout to ensure page-data writes happen after the w…
KyleAMathews Nov 12, 2020
84fb3b0
Only add notInDevBundle during development
KyleAMathews Nov 12, 2020
2cf3a66
Add back mistakenly removed code
KyleAMathews Nov 12, 2020
c202cdf
Didn't need this
KyleAMathews Nov 12, 2020
6f55655
Implement @pieh's idea for telling runtime that dev bundle is loaded
KyleAMathews Nov 12, 2020
eb88597
Fix tests
KyleAMathews Nov 13, 2020
68236bf
Remove logs
KyleAMathews Nov 13, 2020
acfbe67
Merge branch 'master' into devjs-lazy
KyleAMathews Nov 16, 2020
a5fcd13
Put changes behind GATSBY_EXPERIMENT_LAZY_DEVJS flag
KyleAMathews Nov 16, 2020
53051e9
Add temporary fork of development-runtime tests for lazy devjs PR
KyleAMathews Nov 17, 2020
d140a1b
Remove duplicated tests w/ cleaner method @pieh suggested
KyleAMathews Nov 17, 2020
68efb11
Address @pieh feedback
KyleAMathews Nov 17, 2020
433918f
Update packages/gatsby/src/utils/start-server.ts
KyleAMathews Nov 17, 2020
fbd17a9
Remove global middleware
KyleAMathews Nov 17, 2020
3113e12
This isn't true
KyleAMathews Nov 17, 2020
78c0382
Merge branch 'master' into devjs-lazy
KyleAMathews Nov 17, 2020
34151f9
fix lint
KyleAMathews Nov 17, 2020
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
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ aliases:
- notify-status:
condition: << parameters.nightly >>

e2e_tests_development_runtime_lazy_alias:
&e2e_tests_development_runtime_lazy_alias
<<: *e2e-executor
parameters:
nightly:
type: boolean
default: false
environment:
CYPRESS_PROJECT_ID: ihj5mz
CYPRESS_RECORD_KEY: 01acdce8-75bd-4280-9839-6cb215b2c84b
steps:
- e2e-test:
test_path: e2e-tests/lazy-development-runtime
skip_file_change_test: << parameters.nightly >>
- notify-status:
condition: << parameters.nightly >>

e2e_tests_gatsby-image_alias: &e2e_tests_gatsby-image_alias
<<: *e2e-executor
parameters:
Expand Down Expand Up @@ -326,6 +343,13 @@ jobs:
e2e_tests_development_runtime:
<<: *e2e_tests_development_runtime_alias

e2e_tests_development_runtime_lazy_devjs:
<<: *e2e_tests_development_runtime_alias
environment:
GATSBY_EXPERIMENT_LAZY_DEVJS: true
CYPRESS_PROJECT_ID: ihj5mz
CYPRESS_RECORD_KEY: 01acdce8-75bd-4280-9839-6cb215b2c84b

e2e_tests_development_runtime_with_experimental_react:
<<: *e2e_tests_development_runtime_alias

Expand Down Expand Up @@ -597,6 +621,8 @@ workflows:
<<: *e2e-test-workflow
- e2e_tests_development_runtime:
<<: *e2e-test-workflow
- e2e_tests_development_runtime_lazy_devjs:
<<: *e2e-test-workflow
- e2e_tests_production_runtime:
<<: *e2e-test-workflow
- themes_e2e_tests_production_runtime:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Dev loader loadPage should be successful when component can be loaded 1`] = `
Object {
"component": Object {
"chunkName": "bar",
},
"json": Object {
"pageContext": "something something",
},
"page": Object {
"componentChunkName": "chunk",
"matchPath": undefined,
"path": "/mypage/",
"staticQueryHashes": Array [],
"webpackCompilationHash": "123",
},
"staticQueryResults": Object {},
}
`;
Loading