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

[pull] canary from vercel:canary #49

Merged
merged 3,155 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
3155 commits
Select commit Hold shift + click to select a range
8d6f832
Re-add Partytown custom configuration to `Script` component documenta…
guisehn Aug 23, 2024
c29810d
docs: Add required legacyBehavior for passHref to work (#68897)
wesbos Aug 23, 2024
99e5427
docs: fix link to Dynamic Function (#68780)
Juneezee Aug 23, 2024
1b77e7e
docs: change name of component in Jest page (#68661)
OlyaPolya Aug 23, 2024
9e8266a
docs: Enumerate all possible extensions for note (#67958)
paarthmadan Aug 23, 2024
ba99599
docs: fix code out of the code block (#69228)
AhmedBaset Aug 23, 2024
9ecd1a2
Refactored module IDs optimization (#68846)
Aug 23, 2024
957b5fb
Exhaustive modules graph traversal (#68865)
Aug 23, 2024
a21748e
[Tracing] Trace next-dev spans to represent the dev server (#69206)
wbinnssmith Aug 23, 2024
de9a00d
Add support for Instrumentation and Middleware in global module ID op…
Aug 23, 2024
6e15cb1
v15.0.0-canary.128
vercel-release-bot Aug 23, 2024
15c086c
Moved global_module_id_strategy.rs to turbopack-ecmascript crate to a…
Aug 23, 2024
e1ad67d
Changed module id map key from AssetIdent to RcStr (#69076)
Aug 24, 2024
b1e32c5
Turbopack: reapply `typeof module` replacement (#69158)
mischnic Aug 24, 2024
bc5bba8
v15.0.0-canary.129
vercel-release-bot Aug 24, 2024
41c9fe4
Refactor unused import and object in Flight plugin (#69266)
shuding Aug 25, 2024
d588515
v15.0.0-canary.130
vercel-release-bot Aug 25, 2024
d640fed
docs: correct console.log syntax in Pages and App router examples for…
dineshh-m Aug 26, 2024
fbeeb11
examples: update "ENV key value" format format to "ENV key=value" (#6…
avdeev Aug 26, 2024
854a7db
examples: fix ENV warning for Docker example (#69091)
Bhavya031 Aug 26, 2024
74f01e0
examples: Reduce TypeGen boilerplate in Sanity Example (#69134)
stipsan Aug 26, 2024
e192554
refactor: group react dev overlay entry (#69223)
huozhi Aug 26, 2024
5888bb9
fix: Allow guarded usage of node.js APIs from edge runtime (#69283)
kdy1 Aug 26, 2024
18dbf34
docs: examples page (#69187)
leerob Aug 26, 2024
f214bd8
docs: remove broken link (#69209)
leerob Aug 26, 2024
fea70f3
docs: improve data fetching docs and add ISR page (#69285)
leerob Aug 26, 2024
01ae44b
docs: fix a few ISR docs follow up (#69315)
leerob Aug 26, 2024
26a8824
chore(github): update deprecated property in triage issues with ai (#…
samcx Aug 26, 2024
50b5c7b
chore(docs): update docs for error message `no-img-element` (#69312)
styfle Aug 26, 2024
c077d9e
v15.0.0-canary.131
vercel-release-bot Aug 26, 2024
91b979f
Fix async loader modules in graph traversal (#69077)
Aug 27, 2024
1277b3c
Module ID strategies tests (#69110)
Aug 27, 2024
b68b508
handle uncaught exceptions in worker (#69335)
gnoff Aug 27, 2024
7a5b008
Fix action loader modules in graph traversal (#69154)
Aug 27, 2024
d23a7b1
Create empty update_react.yml as a no-op (#69318)
eps1lon Aug 27, 2024
53cf8e2
sync-react: Fix `--version` and `--no-install` being ignored (#69317)
eps1lon Aug 27, 2024
2e74ed6
consolidate handling for well known objects across refs and analysis …
arlyon Aug 27, 2024
d21fc56
Revert "Fix action loader modules in graph traversal" (#69359)
huozhi Aug 27, 2024
268d41d
invert if check for iife to reduce indentation (#69112)
arlyon Aug 27, 2024
e5ae3b2
Docs: Add version tag and history for `instrumentationHook` (#69366)
delbaoliveira Aug 27, 2024
ec92a41
Docs: Add missing debugging page to App Router docs (#69367)
delbaoliveira Aug 27, 2024
4534458
Set max retries for build failures to zero (#69340)
gnoff Aug 27, 2024
1a52d9e
Examples - Updated with-windcss example for App Router (#69365)
archanaagivale30 Aug 27, 2024
bca90db
Docs: Polish CLI pages (#69362)
delbaoliveira Aug 27, 2024
7f57d4b
send initialCanonicalUrl in array format to fix crawler issues (#69370)
ztanner Aug 27, 2024
678b487
remove unused argument to applyPatch (#69376)
ztanner Aug 27, 2024
ab7744e
Respect webpackIgnore and turboIgnore comments in the parser (#68451)
arlyon Aug 27, 2024
169c8fe
fix(turbopack): Store minimumCacheTTL as a u64 (#69379)
bgw Aug 27, 2024
46c6776
docs: fix 404 with debugging guide (#69377)
leerob Aug 27, 2024
0e0fc71
chore(turbopack): Delete dead code in next_core::{app,pages}_structur…
bgw Aug 27, 2024
af6ff37
fix: fix the safari and firefox test modes (#69384)
wyattjoh Aug 27, 2024
69c2d0c
Fix next server component modules in graph traversal (#69157)
Aug 27, 2024
f133f28
v15.0.0-canary.132
vercel-release-bot Aug 27, 2024
59183b9
Change ID generation strategy (#69200)
Aug 27, 2024
5b3365e
Fix async dynamic client modules in graph traversal (#69202)
Aug 28, 2024
cfab473
docs: clarify caching (#69391)
leerob Aug 28, 2024
c1a7463
refactor path creation in walkTreeWithFlightRouterState (#69383)
ztanner Aug 28, 2024
00f70f2
examples: improve Supabase example (#69308)
MildTomato Aug 28, 2024
7da39c7
examples: fix supabase build (#69394)
MildTomato Aug 28, 2024
f149d08
docs: fix link in data fetching (#69382)
leerob Aug 28, 2024
f4c1a40
Partial Fallback Prerendering (#68958)
wyattjoh Aug 28, 2024
c3c38bd
Fix typo on "additonal" to "additional" (#69337)
hiro0218 Aug 28, 2024
d66ea6a
examples: further supabase improvements (#69407)
MildTomato Aug 28, 2024
1e493fc
Create React sync automatically (#69314)
eps1lon Aug 28, 2024
81e136d
Upgrade React from `eb3ad065-20240822` to `f90a6bcc-20240827` (#69415)
vercel-release-bot Aug 28, 2024
bda5c86
Fix test mode detection (#69416)
wyattjoh Aug 28, 2024
e4fabbc
Fix bad peer dependencies (#69418)
eps1lon Aug 28, 2024
c6fe923
v15.0.0-canary.133
vercel-release-bot Aug 28, 2024
992103f
build: Update `swc_core` to `v0.102.0` (#69389)
kdy1 Aug 28, 2024
d822525
chore: add logs to download-swc ci job (#69425)
huozhi Aug 28, 2024
9f93a0c
Upgrade React from `19.0.0-rc-f90a6bcc-20240827` to `19.0.0-rc-7771d3…
vercel-release-bot Aug 28, 2024
1207df6
examples: Updating WordPress example to Next 14 (#62447)
Bjornnyborg Aug 28, 2024
2c18811
v15.0.0-canary.134
vercel-release-bot Aug 28, 2024
8d6e995
Documentation fixed: removes a confusing double negative (#69429)
amikofalvy Aug 28, 2024
f8ec826
docs: fix a calculation mistake (#69363)
yosefbeder Aug 28, 2024
b305c2d
Introduce dynamicIO experiment (#67571)
gnoff Aug 29, 2024
c274f26
Remove redundant code and call module_id_to_lit instead (#69430)
Aug 29, 2024
9720d0a
Add module id strategy option to next config (#69319)
Aug 29, 2024
ad268ef
docs: improve no async client components page (#69440)
leerob Aug 29, 2024
55340eb
validate path lengths before writes and attempt to eagerly convert wi…
arlyon Aug 29, 2024
882d883
build(pack-next): Add an option for the pack-next script to automate …
bgw Aug 29, 2024
66e4477
Rename trace.log -> trace-turbopack to match .next/trace (#69447)
timneutkens Aug 29, 2024
8a360b1
Make module IDs numbers instead of strings (#69431)
Aug 29, 2024
5fb091c
chore(CI): Use Graphite's CI Optimization Feature (#69204)
bgw Aug 29, 2024
b5408d1
cleanup FlightDataPath array access/slicing (#69241)
ztanner Aug 29, 2024
785997f
normalize flight data after receiving server response (#69460)
ztanner Aug 29, 2024
21e51cf
Revert "validate path lengths before writes and attempt to eagerly co…
bgw Aug 29, 2024
38d1987
examples: Add `cms-umbraco` example (#52777)
kjac Aug 29, 2024
7b93ec6
docs: fix missing apostrophe (#69427)
woutvanderploeg Aug 29, 2024
9f258ec
docs: add X to Twitter (#69400)
Ocheretovich Aug 29, 2024
e71b7b5
chore(github): fix tool call (#69470)
samcx Aug 29, 2024
dc6408f
v15.0.0-canary.135
vercel-release-bot Aug 29, 2024
a7c56a5
fix(turbopack-ecmascript-plugins): Accept a partial object for Styled…
bgw Aug 29, 2024
6cfa766
Support turbo: true option for custom server (#69464)
timneutkens Aug 30, 2024
addafa5
Turbopack: JSON5 and package.json for postcss config files (#68679)
mischnic Aug 30, 2024
ae1efa4
bugfix: aliased prefetches should flow through PPR handling (#69476)
ztanner Aug 30, 2024
53201b1
[after] duplicate test pages for edge instead of next.patch (#69477)
lubieowoce Aug 30, 2024
bc0ef9c
docs: clarify ISR behavior (#69501)
ztanner Aug 30, 2024
a085848
v15.0.0-canary.136
vercel-release-bot Aug 30, 2024
e8512b3
fix(CI): Don't require the GRAPHITE_TOKEN secret, as it's not availab…
bgw Aug 30, 2024
fb36def
Example: Updated the example of rewrites to utilize the App Router (#…
Sam-Phillemon9493 Aug 31, 2024
5348798
v15.0.0-canary.137
vercel-release-bot Aug 31, 2024
397a3eb
fix: bump [email protected] (#69524)
styfle Sep 1, 2024
452d27d
v15.0.0-canary.138
vercel-release-bot Sep 1, 2024
ec46f90
docs: Use `useFormState` over `useActionState` (#69547)
leerob Sep 2, 2024
d3f5532
fix: styledComponents schema (#69230)
samcx Sep 2, 2024
1be4c1b
feat(turbopack): Use mangled export names for fake exports (#69124)
kdy1 Sep 2, 2024
77dac1c
v15.0.0-canary.139
vercel-release-bot Sep 2, 2024
d67e020
Turbopack: emit single CSS chunk per page (#69219)
mischnic Sep 3, 2024
adc94b4
feat: Report correct errors for missing `use client` in global-errors…
kdy1 Sep 3, 2024
53596ba
Turbopack build: Implement `regions` and `assets` field in manifest f…
timneutkens Sep 3, 2024
9afc84d
docs: Rewrite `cookies` page to follow template, add missing methods …
delbaoliveira Sep 3, 2024
e366f3b
Explicitly assert on errors instead of the error number (#69512)
eps1lon Sep 3, 2024
d7c6200
Add browser devtool inspect url copy button to dev overlay (#69357)
huozhi Sep 3, 2024
3ff93d9
Match peer dependencies in rsc-binary tests (#69515)
eps1lon Sep 3, 2024
7c6b1a6
Lazily init fetch dedupe cache (#69492)
eps1lon Sep 3, 2024
41fb9d1
Turbopack build: Fix middleware matchers implementation (#69602)
timneutkens Sep 3, 2024
89422a6
fix(scripts): correct globbing, cargo colors, patch path (#69624)
ForsakenHarmony Sep 3, 2024
b70d357
chore(metadata): add clarifying comment (#69549)
samcx Sep 3, 2024
4a392b9
ci: only trigger slack webhook from canary (#69632)
lubieowoce Sep 3, 2024
be04802
Remove unsupported providerImportSource option (#69609)
ProchaLu Sep 3, 2024
1101fa2
fix: clientComponentLoading span type (#69295)
luismiramirez Sep 3, 2024
fe8d79d
Skip devlow benchmark step for forks (#69633)
ijjk Sep 3, 2024
d1f934f
Fix typos (#69568)
omahs Sep 3, 2024
20835f1
fix(eslint): allow typescript-eslint v8 (#68807)
theoludwig Sep 3, 2024
9435b7b
Allow external image urls with _next/image pathname to be rendered vi…
abhi12299 Sep 3, 2024
2c8fcc5
perf: Cache Rust `Regex`es (#69585)
kdy1 Sep 3, 2024
be841a6
v15.0.0-canary.140
vercel-release-bot Sep 3, 2024
0378e94
Updated the example of with-dynamic-import to utilize the App Router.…
PapatMayuri Sep 3, 2024
226594f
refactor(turbo-tasks): Make CURRENT_TASK_STATE shareable across multi…
bgw Sep 4, 2024
4d4d842
refactor(turbo-tasks): Split local and global task state (#68963)
bgw Sep 4, 2024
ffb10ce
docs: Fix invalid arguments for sendGTMEvent (#69297)
robiot Sep 4, 2024
b9b9d68
examples: Supabase follow up fixes (#69392)
leerob Sep 4, 2024
f90c6d7
ensure test_e2e_deploy_release installs native swc binaries (#69638)
ztanner Sep 4, 2024
8493060
fix(turbopack): reduce severity of resolve issues during analysis (#6…
ForsakenHarmony Sep 4, 2024
5854bb3
Turbopack build: Update generate-middleware-source-map test (#69615)
timneutkens Sep 4, 2024
2f5a767
Revert "docs: Fix invalid arguments for sendGTMEvent" (#69653)
timneutkens Sep 4, 2024
52cc01d
Revert "Revert "docs: Fix invalid arguments for sendGTMEvent"" (#69654)
timneutkens Sep 4, 2024
9808d72
fix trace file reloading (#69655)
sokra Sep 4, 2024
3486b2b
Turbopack build: Fix telemetry tests (#68969)
timneutkens Sep 4, 2024
d282e7a
Revert "ci: only trigger slack webhook from canary" (#69648)
ztanner Sep 4, 2024
1660f23
ci: make inputs.skipNativeInstall do what it says (#69674)
lubieowoce Sep 4, 2024
568df76
docs: add links to search params on server/client (#69618)
leerob Sep 4, 2024
38d8301
refactor(turbo-tasks) Add a higher-level task-local state API for the…
bgw Sep 4, 2024
12cbab2
docs(usePathname): add note about using usePathname with rewrites (#6…
samcx Sep 4, 2024
4b4fd80
chore(turbo-tasks): Move Invalidator struct from manager.rs to invali…
bgw Sep 4, 2024
158a740
[Turbopack] transient when the self argument is transient (#69657)
sokra Sep 4, 2024
6de8377
[Turbopack] store project options in state (#69658)
sokra Sep 4, 2024
3b567f1
refactor(turbo-tasks): Add stubs for RawVc::TaskOutput (#68908)
bgw Sep 4, 2024
7fc8076
fix merge conflict (#69690)
sokra Sep 4, 2024
4c0728d
[Turbopack] use file.read() instead of file.track() in webpack loader…
sokra Sep 4, 2024
184ec1c
[Turbopack] no need to depend on write completion (#69660)
sokra Sep 4, 2024
18d32b0
Update the preview tarball binaries (#69692)
ijjk Sep 4, 2024
0da5c25
[Turbopack] gracefully stop turbo-tasks to allow persisting to comple…
sokra Sep 4, 2024
258a453
docs: update note on caching and db/orms (#69695)
sommeeeer Sep 4, 2024
afcad43
fix: ensure absolute paths are handled correctly with `--file` option…
lumirlumir Sep 4, 2024
1b89d7d
refactor(github): refactor triage-issues-with-ai to generateObject (#…
samcx Sep 4, 2024
2aa2bca
dev-overlay: Implement CopyButton without useActionState or async tra…
eps1lon Sep 4, 2024
b3e434e
fix: Allow subset of node.js APIs for edge (#69675)
kdy1 Sep 4, 2024
caa72ff
Update `swc_core` to `v0.103.1` (#69605)
kdy1 Sep 4, 2024
e9cbf27
Run link-ref tests in /app and /pages (#69564)
eps1lon Sep 4, 2024
5af45db
v15.0.0-canary.141
vercel-release-bot Sep 4, 2024
a9e602e
Partial Fallback Prerendering Route Shells (#69282)
wyattjoh Sep 5, 2024
db71b6a
docs: add PWA docs with App Router (#69647)
leerob Sep 5, 2024
a18cd16
docs: Update `unstable_cache` indentation (#69700)
leerob Sep 5, 2024
7198111
Ensure externalized React entrypoints use vendored React in App Route…
eps1lon Sep 5, 2024
63e0298
docs: fix data fetching with ORM (#69702)
leerob Sep 5, 2024
668558a
Turbopack dev/build: Ensure @vercel/og is external in Node.js environ…
timneutkens Sep 5, 2024
8662ba0
Turbopack build: Skip irrelevant telemetry tests (#69671)
timneutkens Sep 5, 2024
6853c6f
fix(turbopack): Pass `resourceQuery` to loaders (#69703)
kdy1 Sep 5, 2024
4f038db
Docs: Fix `cookies` page code blocks (#69719)
delbaoliveira Sep 5, 2024
b817354
Turbopack build: Implement --experimental-app-only flag (#69722)
timneutkens Sep 5, 2024
2595a27
Use vendored React version in Middleware and Instrumentation (#69619)
eps1lon Sep 5, 2024
18f237c
Turbopack build: Skip webpack config tests (#69729)
timneutkens Sep 5, 2024
4a4ff6c
[Turbopack] fix serialization problems/bugs (#69662)
sokra Sep 5, 2024
c14e435
[Turbopack] refactoring/todos (#69663)
sokra Sep 5, 2024
cf62dcc
separate hydration tests for pages router (#69733)
huozhi Sep 5, 2024
a16ea9e
docs: fix typo in doc on rendering (#69636)
royalfig Sep 5, 2024
537f9cc
docs: fix typo (#69731)
sommeeeer Sep 5, 2024
15900e0
misc: typo in var name (#69745)
devjiwonchoi Sep 5, 2024
90691cf
Partial Prerendering Basepath Fix (#69520)
wyattjoh Sep 5, 2024
b0086f0
refactor some of the font code (#69146)
arlyon Sep 5, 2024
96c1b17
v15.0.0-canary.142
vercel-release-bot Sep 5, 2024
4462e4f
Turbopack build: Update css modules tests (#69730)
timneutkens Sep 5, 2024
ce38d37
Update 16-progressive-web-apps.mdx (#69727)
iampoul Sep 5, 2024
e329415
v15.0.0-canary.143
vercel-release-bot Sep 5, 2024
a5f30e6
pages bugfix: prevent cancellation errors from being logged (#69766)
ztanner Sep 6, 2024
faef2f1
Turbopack build: Fix next-image-new/base-path test (#69783)
timneutkens Sep 6, 2024
d463bde
chore(turbopack-ecmascript): Remove unneeded async recursion '_boxed'…
bgw Sep 6, 2024
87e91d5
Disable experimental.optimizeServer by default (#69788)
huozhi Sep 6, 2024
a9bfc64
[Turbopack] handle state serialization (#69670)
sokra Sep 6, 2024
ec7b33e
[Turbopack] fix require.resolve self hanging (#69793)
sokra Sep 6, 2024
2fa1633
Turbopack dev/build: Ignore empty tsconfig/jsconfig (#69795)
timneutkens Sep 6, 2024
38e6206
Fix middleware fallback: false case (#69799)
ijjk Sep 6, 2024
6bf5a8a
docs: document the next/dynamic case with ssr: false option (#69741)
huozhi Sep 6, 2024
555302b
v15.0.0-canary.144
vercel-release-bot Sep 6, 2024
ef2decf
create-next-app: fix font file corruption when using import alias (#6…
ztanner Sep 6, 2024
3bb7415
chore(github): add issues_version.yml workflow (#69810)
samcx Sep 7, 2024
1092087
v15.0.0-canary.145
vercel-release-bot Sep 7, 2024
ce7c8b0
Turbopack build: Fix middleware dead code elimination test (#69828)
timneutkens Sep 8, 2024
e35b5cd
v15.0.0-canary.146
vercel-release-bot Sep 8, 2024
0738eb0
fix: Fix find_turbopack_part_id_in_asserts in the PartId::Export(e) c…
Sep 9, 2024
6599b32
ensure aliased prefetches return correct segment key (#69850)
ztanner Sep 9, 2024
935460c
feat(turbopack-ecmascript): Add implementation for webpackIgnore and …
bgw Sep 9, 2024
a9c88d2
feat(turbopack): add `experimental.turbo.root` config option (#69737)
ForsakenHarmony Sep 9, 2024
ab493f1
Turbopack dev/build: Initial browserslist passing (#69781)
timneutkens Sep 9, 2024
b825912
Turbopack: analyze `new Worker` calls (#69584)
mischnic Sep 9, 2024
d077768
Turbopack: Worker chunks (#69734)
mischnic Sep 9, 2024
0eea1be
Docs: Refactor and tidy Link docs (#69724)
molebox Sep 9, 2024
d169cf3
[Turbopack] only subscribe to changes in dev mode (#69862)
sokra Sep 9, 2024
b368fea
HMR: Log unexpected Turbopack errors to a file (#68698)
wbinnssmith Sep 9, 2024
833b5b0
chore(turbopack-ecmascript): Remove more `_boxed` async recursion hel…
bgw Sep 9, 2024
e8de692
test: add test for parallel route nav case (#69871)
huozhi Sep 9, 2024
a68d1fa
Docs: Refactor `draftMode()` page to follow template, document missin…
delbaoliveira Sep 9, 2024
af6a3d1
test: lock ts type check (#69889)
huozhi Sep 9, 2024
cd7949f
fix: use correct protocol when -H and --experimental-https are enable…
txxxxc Sep 9, 2024
29454f0
fix: remove unnecessary console in `isDynamicPostpone` (#69457)
zce Sep 9, 2024
6964e22
Turbopack build: Skip webpack specific test (#69875)
timneutkens Sep 9, 2024
f3c537b
updated the example of modularize-imports to utilize the App Router (…
Sam-Phillemon9493 Sep 9, 2024
1dc3f39
Turbopack build: Fix typeof-window-replace tests (#69883)
timneutkens Sep 9, 2024
a916dfc
Add ability to customize Cache-Control (#69802)
ijjk Sep 9, 2024
644b6c6
docs(link): update scroll docs (#69894)
samcx Sep 9, 2024
0f2845d
Support React 18 in Pages Router (#69484)
eps1lon Sep 9, 2024
2b9f1bc
chore(cna): re-add /public (#69887)
samcx Sep 9, 2024
a8a64c9
v15.0.0-canary.147
vercel-release-bot Sep 9, 2024
f9148a2
docs(link): additional updates with regards to scrolling behavior in …
samcx Sep 9, 2024
fcde8fc
Turbopack: allow specified AssetIdents for naming chunk groups (#68917)
wbinnssmith Sep 9, 2024
69f07b6
Revert "Support React 18 in Pages Router" (#69911)
timneutkens Sep 10, 2024
c5961c4
v15.0.0-canary.148
vercel-release-bot Sep 10, 2024
1a3bc59
Turbopack build: Fix script-loader test (#69867)
timneutkens Sep 10, 2024
23c4cf0
docs(revalidate): add not about revalidate in Development (#69898)
samcx Sep 10, 2024
25eda2e
docs: add missing `og:video` meta tag (#69644)
Marukome0743 Sep 10, 2024
ca90723
feat: Add a lint for deprecated APIs (#69772)
kdy1 Sep 10, 2024
55adc36
Turbopack build: Fix process.browser tests (#69919)
timneutkens Sep 10, 2024
adb6063
Turbopack build: Fix next-image invalid import test (#69921)
timneutkens Sep 10, 2024
3113d80
docs: typo fowards to forwards (#69899)
Marukome0743 Sep 10, 2024
47072bf
Pass client trace metadata to client in pages router (#69620)
lforst Sep 10, 2024
497f9e8
Turbopack build: Skip webpack specific test (#69923)
timneutkens Sep 10, 2024
fa53822
Reapply "validate path lengths before writes and attempt to eagerly c…
arlyon Sep 10, 2024
6d14461
refactor(turbo-tasks): Remove some `format_description` logic from me…
bgw Sep 10, 2024
b755e1e
refactor(turbo-tasks): Move OutputContent from memory backend into tu…
bgw Sep 10, 2024
cfdd5dc
refactor(turbo-tasks-memory): Minor cleanup of code in turbo-tasks-me…
bgw Sep 10, 2024
c58c6b7
Turbopack: more static typeof replacements for ESM (#69914)
mischnic Sep 10, 2024
476e43b
Turbopack: Fix server action sourcemaps (#69884)
mischnic Sep 10, 2024
eda6948
Fix font size for build error version status (#69811)
mamuso Sep 10, 2024
dfff673
v15.0.0-canary.149
vercel-release-bot Sep 10, 2024
f760882
chore(github): update channel for popular-issues (#69941)
samcx Sep 10, 2024
76bfdd1
fix: Fix the list of node.js modules compatible with edge (#69801)
kdy1 Sep 11, 2024
2a87b33
feat(image-optimizer): use previously cached image cache entry if ups…
kahlstrm Sep 11, 2024
3d303a1
Turbopack build: Fix build-output tests (#69957)
timneutkens Sep 11, 2024
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
Add additional handling for experimental tracing (vercel#67785)
This adds additional trace handling under the experimental trace mode.
Outside of the feature flag the bloom filter for app router paths used
in pages to hard navigate was updated to no longer be inlined by default
with webpack to avoid invalidating the main bundle for pages too often.
Instead the bloom filter data is stored in the `_buildManifest` file
which is only used in the pages router and is easier to update as it's
per-build already.

This tracing feature is still very experimental and should not be
leveraged in production or outside of testing.

---------

Co-authored-by: Zack Tanner <[email protected]>
  • Loading branch information
ijjk and ztanner authored Jul 17, 2024
commit bdf82000a8996a24e6e6672ff751035373f2134f
221 changes: 221 additions & 0 deletions packages/next/src/build/flying-shuttle/detect-changed-entries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
import fs from 'fs'
import path from 'path'
import crypto from 'crypto'
import { getPageFromPath } from '../entries'
import { Sema } from 'next/dist/compiled/async-sema'

export interface DetectedEntriesResult {
app: string[]
pages: string[]
}

let _hasShuttle: undefined | boolean = undefined
export async function hasShuttle(shuttleDir: string) {
if (typeof _hasShuttle === 'boolean') {
return _hasShuttle
}
_hasShuttle = await fs.promises
.access(path.join(shuttleDir, 'server'))
.then(() => true)
.catch(() => false)

return _hasShuttle
}

export async function detectChangedEntries({
appPaths,
pagesPaths,
pageExtensions,
distDir,
shuttleDir,
}: {
appPaths?: string[]
pagesPaths?: string[]
pageExtensions: string[]
distDir: string
shuttleDir: string
}): Promise<{
changed: DetectedEntriesResult
unchanged: DetectedEntriesResult
}> {
const changedEntries: {
app: string[]
pages: string[]
} = {
app: [],
pages: [],
}
const unchangedEntries: typeof changedEntries = {
app: [],
pages: [],
}

if (!(await hasShuttle(shuttleDir))) {
// no shuttle so consider everything changed
console.log(`no shuttle. can't detect changes`)
return {
changed: {
pages: pagesPaths || [],
app: appPaths || [],
},
unchanged: {
pages: [],
app: [],
},
}
}

const hashCache = new Map<string, string>()

async function computeHash(p: string): Promise<string> {
let hash = hashCache.get(p)
if (hash) {
return hash
}
return new Promise((resolve, reject) => {
const hashInst = crypto.createHash('sha1')
const stream = fs.createReadStream(p)
stream.on('error', (err) => reject(err))
stream.on('data', (chunk) => hashInst.update(chunk))
stream.on('end', () => {
const digest = hashInst.digest('hex')
resolve(digest)
hashCache.set(p, digest)
})
})
}

const hashSema = new Sema(16)
let globalEntryChanged = false

async function detectChange({
normalizedEntry,
entry,
type,
}: {
entry: string
normalizedEntry: string
type: keyof typeof changedEntries
}) {
const traceFile = path.join(
shuttleDir,
'server',
type,
`${normalizedEntry}.js.nft.json`
)
let changed = true

// we don't need to check any further entry's dependencies if
// a global entry changed since that invalidates everything
if (!globalEntryChanged) {
try {
const traceData: {
fileHashes: Record<string, string>
} = JSON.parse(await fs.promises.readFile(traceFile, 'utf8'))

if (traceData) {
let changedDependency = false
await Promise.all(
Object.keys(traceData.fileHashes).map(async (file) => {
try {
if (changedDependency) return
await hashSema.acquire()
const relativeTraceFile = path.relative(
path.join(shuttleDir, 'server', type),
traceFile
)
const originalTraceFile = path.join(
distDir,
'server',
type,
relativeTraceFile
)
const absoluteFile = path.join(
path.dirname(originalTraceFile),
file
)

if (absoluteFile.startsWith(distDir)) {
return
}

const prevHash = traceData.fileHashes[file]
const curHash = await computeHash(absoluteFile)

if (prevHash !== curHash) {
console.log('detected change on', {
prevHash,
curHash,
file,
entry: normalizedEntry,
})
changedDependency = true
}
} finally {
hashSema.release()
}
})
)

if (!changedDependency) {
changed = false
}
} else {
console.error('missing trace data', traceFile, normalizedEntry)
}
} catch (err) {
console.error(`Failed to detect change for ${entry}`, err)
}
}

// we always rebuild global entries so we have a version
// that matches the newest build/runtime
const isGlobalEntry = /(_app|_document|_error)/.test(entry)

if (changed || isGlobalEntry) {
// if a global entry changed all entries are changed
if (!globalEntryChanged && isGlobalEntry) {
console.log(`global entry ${entry} changed invalidating all entries`)
globalEntryChanged = true
// move unchanged to changed
changedEntries[type].push(...unchangedEntries[type])
}
changedEntries[type].push(entry)
} else {
unchangedEntries[type].push(entry)
}
}

// loop over entries and their dependency's hashes
// to detect which changed
for (const entry of pagesPaths || []) {
let normalizedEntry = getPageFromPath(entry, pageExtensions)

if (normalizedEntry === '/') {
normalizedEntry = '/index'
}
await detectChange({ entry, normalizedEntry, type: 'pages' })
}

for (const entry of appPaths || []) {
const normalizedEntry = getPageFromPath(entry, pageExtensions)
await detectChange({ entry, normalizedEntry, type: 'app' })
}

console.log(
'changed entries',
JSON.stringify(
{
changedEntries,
unchangedEntries,
},
null,
2
)
)

return {
changed: changedEntries,
unchanged: unchangedEntries,
}
}
Loading