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

Handle empty pageData during HMR #3412

Merged
merged 3 commits into from
Jan 21, 2023
Merged

Handle empty pageData during HMR #3412

merged 3 commits into from
Jan 21, 2023

Conversation

jridgewell
Copy link
Contributor

Our pageData HMR process treated an undefined response as an error condition, but if the page doesn't have a getXyzProps exported method, then this is the default response. This prevented us from having any pages without page props.

The new code just sends down an empty object, which seems to work for establishing the connection. HMR updates are sent down (and seem to trigger restarts, at least from what I tested with getStaticProps).

Fixes WEB-445

@jridgewell jridgewell requested a review from a team as a code owner January 21, 2023 03:00
@vercel
Copy link

vercel bot commented Jan 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

10 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-cra-web ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
examples-tailwind-web ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Jan 21, 2023 at 5:31AM (UTC)
turbo-vite-web ⬜️ Ignored (Inspect) Jan 21, 2023 at 5:31AM (UTC)

@jridgewell jridgewell added the pr: automerge Kodiak will merge these automatically after checks pass label Jan 21, 2023
@github-actions
Copy link
Contributor

Benchmark for 2555971

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8203.50µs ± 37.40µs 8165.81µs ± 42.93µs -0.46%
bench_hmr_to_commit/Turbopack RCC/1000 modules 8469.46µs ± 47.39µs 8461.73µs ± 47.63µs -0.09%
bench_hmr_to_commit/Turbopack RSC/1000 modules 443.75ms ± 2.81ms 449.12ms ± 1.76ms +1.21%
bench_hmr_to_commit/Turbopack SSR/1000 modules 8344.15µs ± 66.03µs 8330.58µs ± 69.86µs -0.16%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7294.58µs ± 66.81µs 7281.67µs ± 43.92µs -0.18%
bench_hmr_to_eval/Turbopack RCC/1000 modules 7371.86µs ± 43.62µs 7342.84µs ± 53.98µs -0.39%
bench_hmr_to_eval/Turbopack SSR/1000 modules 7345.06µs ± 65.70µs 7376.82µs ± 58.64µs +0.43%
bench_hydration/Turbopack RCC/1000 modules 3323.99ms ± 6.40ms 3335.07ms ± 12.83ms +0.33%
bench_hydration/Turbopack RSC/1000 modules 2786.58ms ± 5.50ms 2787.35ms ± 6.25ms +0.03%
bench_hydration/Turbopack SSR/1000 modules 2593.62ms ± 8.75ms 2583.97ms ± 8.14ms -0.37%
bench_startup/Turbopack CSR/1000 modules 1605.53ms ± 4.34ms 1609.89ms ± 5.18ms +0.27%
bench_startup/Turbopack RCC/1000 modules 2455.21ms ± 9.84ms 2451.69ms ± 11.64ms -0.14%
bench_startup/Turbopack RSC/1000 modules 2361.15ms ± 7.11ms 2342.58ms ± 6.87ms -0.79%
bench_startup/Turbopack SSR/1000 modules 2028.75ms ± 6.32ms 2034.51ms ± 4.75ms +0.28%

@github-actions
Copy link
Contributor

Benchmark for a027086

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8742.58µs ± 55.56µs 8785.85µs ± 66.24µs +0.49%
bench_hmr_to_commit/Turbopack RCC/1000 modules 9016.79µs ± 70.74µs 8986.87µs ± 62.58µs -0.33%
bench_hmr_to_commit/Turbopack RSC/1000 modules 459.73ms ± 1.57ms 457.26ms ± 2.94ms -0.54%
bench_hmr_to_commit/Turbopack SSR/1000 modules 8846.51µs ± 76.18µs 8976.41µs ± 110.11µs +1.47%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7779.62µs ± 79.26µs 7753.02µs ± 52.56µs -0.34%
bench_hmr_to_eval/Turbopack RCC/1000 modules 7821.27µs ± 59.72µs 7861.42µs ± 56.58µs +0.51%
bench_hmr_to_eval/Turbopack SSR/1000 modules 7827.34µs ± 53.27µs 7953.30µs ± 66.47µs +1.61%
bench_hydration/Turbopack RCC/1000 modules 3444.06ms ± 8.11ms 3431.30ms ± 10.96ms -0.37%
bench_hydration/Turbopack RSC/1000 modules 2859.57ms ± 8.71ms 2842.48ms ± 11.05ms -0.60%
bench_hydration/Turbopack SSR/1000 modules 2658.26ms ± 8.36ms 2658.20ms ± 8.63ms -0.00%
bench_startup/Turbopack CSR/1000 modules 1656.23ms ± 3.11ms 1645.65ms ± 2.56ms -0.64%
bench_startup/Turbopack RCC/1000 modules 2536.92ms ± 5.59ms 2515.65ms ± 8.13ms -0.84%
bench_startup/Turbopack RSC/1000 modules 2411.22ms ± 5.43ms 2424.84ms ± 6.13ms +0.56%
bench_startup/Turbopack SSR/1000 modules 2082.18ms ± 4.39ms 2081.23ms ± 4.78ms -0.05%

@github-actions
Copy link
Contributor

🟢 CI successful 🟢

Thanks

@kodiakhq kodiakhq bot merged commit 8feec65 into main Jan 21, 2023
@kodiakhq kodiakhq bot deleted the jrl-empty-data branch January 21, 2023 06:47
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Jan 21, 2023
jridgewell added a commit to vercel/next.js that referenced this pull request Mar 10, 2023
Our `pageData` HMR process treated an undefined response as an error condition, but if the page doesn't have a `getXyzProps` exported method, then this is the default response. This prevented us from having any pages without page props.

The new code just sends down an empty object, which seems to work for establishing the connection. HMR updates are sent down (and seem to trigger restarts, at least from what I tested with `getStaticProps`).

Fixes WEB-445
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
Our `pageData` HMR process treated an undefined response as an error condition, but if the page doesn't have a `getXyzProps` exported method, then this is the default response. This prevented us from having any pages without page props.

The new code just sends down an empty object, which seems to work for establishing the connection. HMR updates are sent down (and seem to trigger restarts, at least from what I tested with `getStaticProps`).

Fixes WEB-445
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
Our `pageData` HMR process treated an undefined response as an error condition, but if the page doesn't have a `getXyzProps` exported method, then this is the default response. This prevented us from having any pages without page props.

The new code just sends down an empty object, which seems to work for establishing the connection. HMR updates are sent down (and seem to trigger restarts, at least from what I tested with `getStaticProps`).

Fixes WEB-445
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
Our `pageData` HMR process treated an undefined response as an error condition, but if the page doesn't have a `getXyzProps` exported method, then this is the default response. This prevented us from having any pages without page props.

The new code just sends down an empty object, which seems to work for establishing the connection. HMR updates are sent down (and seem to trigger restarts, at least from what I tested with `getStaticProps`).

Fixes WEB-445
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
Our `pageData` HMR process treated an undefined response as an error condition, but if the page doesn't have a `getXyzProps` exported method, then this is the default response. This prevented us from having any pages without page props.

The new code just sends down an empty object, which seems to work for establishing the connection. HMR updates are sent down (and seem to trigger restarts, at least from what I tested with `getStaticProps`).

Fixes WEB-445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants