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
Move next-*
crates from Turbopack
#47019
Commits on Nov 3, 2022
-
Fix React Refresh boundary finding for CSR (vercel/turbo#2574)
* Fix React Refresh boundary finding We forgot to enable the transform, which means we were rendering from the root of the app instead of the changed component. * Update snapshots * Add comment Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Commits on Nov 4, 2022
Commits on Nov 7, 2022
-
add RSC and RCC for turbopack to benchmarks (vercel/turbo#2620)
* fixup ropes * add RSC and RCC for turbopack to benchmarks RSC: whole page is a server component RCC: whole page is a client component add `app` directory to test app
Commits on Nov 8, 2022
-
order routes by specificity (vercel/turbo#2614)
* bugfix source maps in app dir * add specificity static assets are preferred over dynamic matches
Commits on Nov 9, 2022
-
add different keyed app route elements (vercel/turbo#2636)
* add different keyed app route elements * update for latest next.js canary version * fix header name * setup next.js version in benchmark
Commits on Nov 10, 2022
Commits on Nov 12, 2022
Commits on Nov 14, 2022
-
Add profiling docs (vercel/turbo#2664)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
-
retry CI setup steps if needed (vercel/turbo#2692)
* retry setup steps if needed * retry install nextest step * retry browser launch * ignore errors from PR comment failing due to PR from fork
-
-
-
feat: polyfill
global
withglobalThis
(vercel/turbo#2666)This PR changes the ecmascript chunk logic to polyfill `global` with `globalThis`. A more complex and less performant solution (but with the benefit of us knowing the runtime environment) would be to add an effect for simple identifier expressions.
Commits on Nov 16, 2022
-
use iterations feature from criterion (vercel/turbo#2708)
* use iterations feature from criterion move startup, warmup and teardown out of the iteration loop to avoid tracking this time as elapsed time this allows criterion to use the measurement time correctly for the measured task prefer slope over mean when possible as it estimates the real time (excluding warmup) * remove warmup argument * stop server for next iteration * refactor * restore verbose info, exclude file read from timing * add a little bit of delay between HMR updates * make a warmup change * no need to copy template dir for HMR benchmark * add delay after warmup change * add watch benchmark * add/fix comments * fix env var in CI
-
fix HMR for RSC benchmarking (vercel/turbo#2698)
measure hmr_to_commit with detector component add Next.js 13 to benchmarks with RSC and RCC measurements this tests RSC HMR make HMR warmup faster make browser launch lazy test benchmarks for other bundlers on CI too # Conflicts: # .github/workflows/test.yml # crates/next-dev/benches/mod.rs
Commits on Nov 17, 2022
Commits on Nov 19, 2022
Commits on Nov 22, 2022
Commits on Nov 23, 2022
Commits on Nov 25, 2022
-
-
get upstream error overlay changes and fix typescript errors (vercel/…
…turbo#2830) * pull upstream changes * ts fixes
Commits on Nov 28, 2022
-
Sample many modules in benchmarks + reliability fixes (vercel/turbo#2750
-
build(cargo): setup next-binding package (vercel/turbo#2813)
* build(cargo): setup next-binding package * build(cargo): update dependencies * style(toml): update config * ci(actions): check next-binding * feat(next-binding): reexports * build(cargo): update lockfile
Commits on Nov 29, 2022
-
fix and improve hanging detection (vercel/turbo#2827)
Commit 1: It took me hours to figure out this unsafe problem... Commit 2: updates tokio Commit 3: improves hanging detection to allow to attach notes to event listeners
-
Make task stats take less memory by default (vercel/turbo#2765)
* Make task stats take less memory by default * Swap order of condition operands * TaskStats -> ExportedTaskStats * Add full stats disclaimers * Clippy * Fix duplicate labels * Move stats type reporting to TurboTasks * Fix turbotrace and turbopack visualization * Store last duration and execution as SmallDurations Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
-
error overlay redesign (vercel/turbo#2831)
* refactor exports * tabs + styles + icons
-
Commits on Dec 1, 2022
-
Run taplo format and check consistency in CI (vercel/turbo#2866)
* Add GitHub action step for taplo --check * Run taplo format
-
-
Support basic next/image loading (vercel/turbo#2481)
This implements basic support for serving the images requested by `next/image` and `next/future/image`. The big missing features are: - image width resizing (and thus blurry image placeholders) - image quality encoding - format re-encoding This required a lot more work than I expected, because we have to also override the `remotePatterns` to allow using `next/image` with remote images. The only way I found to do this was to override the `__NEXT_IMAGE_OPTS` env var, which is a special object value injected by webpack's `DefinePlugin` as if it were an `process.env` value. Fixes https://github.com/vercel/web-tooling-internal/issues/5 Porting from https://github.com/vercel/the-three-body/pull/212 Fixes WEB-150 Fixes WEB-2
-
Commits on Dec 2, 2022
Commits on Dec 3, 2022
-
chore(deps): update rust crate futures to 0.3.25 (vercel/turbo#2915)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dev-dependencies | patch | `0.3.21` -> `0.3.25` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.21` -> `0.3.25` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.24` -> `0.3.25` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>rust-lang/futures-rs</summary> ### [`v0.3.25`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0325---2022-10-20) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.24...0.3.25) - Fix soundness issue in `join!` and `try_join!` macros ([#&vercel/turbo#8203;2649](https://togithub.com/rust-lang/futures-rs/issues/2649)) - Implement `Clone` for `sink::Drain` ([#&vercel/turbo#8203;2650](https://togithub.com/rust-lang/futures-rs/issues/2650)) ### [`v0.3.24`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0324---2022-08-29) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.23...0.3.24) - Fix incorrect termination of `select_with_strategy` streams ([#&vercel/turbo#8203;2635](https://togithub.com/rust-lang/futures-rs/issues/2635)) ### [`v0.3.23`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0323---2022-08-14) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.22...0.3.23) - Work around MSRV increase due to a cargo bug. ### [`v0.3.22`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0322---2022-08-14) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.21...0.3.22) - Fix `Sync` impl of `BiLockGuard` ([#&vercel/turbo#8203;2570](https://togithub.com/rust-lang/futures-rs/issues/2570)) - Fix partial iteration in `FuturesUnordered` ([#&vercel/turbo#8203;2574](https://togithub.com/rust-lang/futures-rs/issues/2574)) - Fix false detection of inner panics in `Shared` ([#&vercel/turbo#8203;2576](https://togithub.com/rust-lang/futures-rs/issues/2576)) - Add `Mutex::lock_owned` and `Mutex::try_lock_owned` ([#&vercel/turbo#8203;2571](https://togithub.com/rust-lang/futures-rs/issues/2571)) - Add `io::copy_buf_abortable` ([#&vercel/turbo#8203;2507](https://togithub.com/rust-lang/futures-rs/issues/2507)) - Remove `Unpin` bound from `TryStreamExt::into_async_read` ([#&vercel/turbo#8203;2599](https://togithub.com/rust-lang/futures-rs/issues/2599)) - Make `run_until_stalled` handle self-waking futures ([#&vercel/turbo#8203;2593](https://togithub.com/rust-lang/futures-rs/issues/2593)) - Use `FuturesOrdered` in `try_join_all` ([#&vercel/turbo#8203;2556](https://togithub.com/rust-lang/futures-rs/issues/2556)) - Fix orderings in `LocalPool` waker ([#&vercel/turbo#8203;2608](https://togithub.com/rust-lang/futures-rs/issues/2608)) - Fix `stream::Chunk` adapters size hints ([#&vercel/turbo#8203;2611](https://togithub.com/rust-lang/futures-rs/issues/2611)) - Add `push_front` and `push_back` to `FuturesOrdered` ([#&vercel/turbo#8203;2591](https://togithub.com/rust-lang/futures-rs/issues/2591)) - Deprecate `FuturesOrdered::push` in favor of `FuturesOrdered::push_back` ([#&vercel/turbo#8203;2591](https://togithub.com/rust-lang/futures-rs/issues/2591)) - Performance improvements ([#&vercel/turbo#8203;2583](https://togithub.com/rust-lang/futures-rs/issues/2583), [#&vercel/turbo#8203;2626](https://togithub.com/rust-lang/futures-rs/issues/2626)) - Documentation improvements ([#&vercel/turbo#8203;2579](https://togithub.com/rust-lang/futures-rs/issues/2579), [#&vercel/turbo#8203;2604](https://togithub.com/rust-lang/futures-rs/issues/2604), [#&vercel/turbo#8203;2613](https://togithub.com/rust-lang/futures-rs/issues/2613)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/vercel/turbo).
-
update chromiumoxide (vercel/turbo#2916)
updating in hope that this fixes the random errors in test runs
Commits on Dec 5, 2022
-
-
@next/font [1/n] Add query structure to module requests (vercel/turbo…
…#2743) * Add query structure to module requests * Update crates/next-dev/src/lib.rs Co-authored-by: Justin Ridgewell <justin@ridgewell.name> Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
-
Commits on Dec 6, 2022
-
@next/font [2/n] Apply next/font swc transform (vercel/turbo#2742)
* Check in next-font transform from Next.js repo * Use next-font transform * Run transform via custom rule * Place next/font transform behind cargo feature
-
Remove unused dependencies (vercel/turbo#2934)
* Remove unused dependencies * Add back lazy static as a dev dep * Add back bench dependencies
Commits on Dec 8, 2022
-
[5/n]
@next/font/google
: Port utilities for generating stylesheet u……rls (vercel/turbo#2856) * Implement get_font_axes * Implement get_stylesheet_url * Handle font axes without wght Co-authored-by: Hannes Bornö <hannes.borno@vercel.com> * Implement extract_font_urls * Update crates/next-core/src/next_font_google/util.rs Co-authored-by: Justin Ridgewell <justin@ridgewell.name> * Remove extraction of fonts Co-authored-by: Hannes Bornö <hannes.borno@vercel.com> Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
-
[6/n] @next/font/google: Cache stylesheet locally (vercel/turbo#2940)
* Add font-data.json * Initial implementation of dynamic ImportMapping replacement * Extract font urls * Download fonts * Update stylesheet * Vc-ify * Apply suggestions from code review Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com> * Check in font-data.json update script and update font-data.json * Add font update to ci schedule * assert -> bail * Remove extraction and caching of fonts Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
Commits on Dec 9, 2022
Commits on Dec 10, 2022
Commits on Dec 12, 2022
-
-
Run setup-node in update-google-fonts workflow (vercel/turbo#2980)
* Run setup-node in update-google-fonts workflow * Update Google font-data.json (ce83bb98897404b791fd96f562a95fc0b20b40da) Co-authored-by: wbinnssmith <wbinnssmith@users.noreply.github.com>
Commits on Dec 13, 2022
-
turbo-tasks-fetch: Emit issues on failed fetches (vercel/turbo#2964)
* Initial implementation of FetchIssue * turbo-tasks-fetch: Emit issues for failed fetches * Use FetchResult and handle failure in `@next/font/google` * Apply suggestions from code review Co-authored-by: Leah <github.leah@hrmny.sh> Co-authored-by: Leah <github.leah@hrmny.sh>
-
Unmark @next/font/google as unsupported and move feature to gate @nex…
…t/font/local only (vercel/turbo#2965)
-
@next/font/google: Hash filenames used in virtual file paths (vercel/…
…turbo#2978) * Implement `DeterministicHash` for `&str` * @next/font/google: Hash filenames used in virtual file paths * Apply suggestions from code review Co-authored-by: Leah <github.leah@hrmny.sh> Co-authored-by: Leah <github.leah@hrmny.sh>
-
feat(rust-port): Split up shim and cli (vercel/turbo#2970)
* Created two separate chains for executing commands: One that uses the parsed arguments from clap that are serialized to json, the other that still uses Cobra. Now to test to ensure that both do the same thing * Adjusted json serialization. Now debugging * Hooked up new CLI to commands * Fixing compile error * fixing lint error * Fixing more Go lint errors * Fixing lint errors * fixing up tests * Only using turbo state with link, login, and logout commands * Reverting changes * Removing more changes * Deleting code and fixing lints * Removed unlink command * Fixing bugs * Reverting more changes * fixed all tests * Refactored away duplicates using CLIConfigProvider interface * Lint fixes * Minor order tweak * Added error if command is not handled * PR feedback * Minor fixes. Adding --__test-run flag * Added workaround for subcommand help * Moved logic around to accomodate login/logout/link/unlink * Added some documentation, removed some printf * Adding more tests. * Hooked up link/login/unlink to --__test-run flag. Also added prysk tests for it. * Split up derive into multiple lines * Added comment explaining clap v3 in Cargo.toml * Ported daemon * Cleaning up code. Removed imports * Fix lints * Fixing lints * Ported prune to Rust CLI * Going all the way. Porting run to Rust CLI and upgrading back to clap v4 * Always gotta be testing * Always be testing. Always. Be. Testing. * Added tests for each singular flag. Now for combination tests * WIP: Hooking up Rust CLI to Go run logic * Disable color * Removed root inference from Go side * Fixing compile errors * Update cli/cmd/turbo/main.go Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com> * Patching up code for run * PR changes * Restored labeler * Restore og.tsx * Reverted run changes that somehow made it in here * Fix run * Update cli/internal/turbostate/turbostate.go Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com> * feat: polyfill `global` with `globalThis` (vercel/turbo#2666) This PR changes the ecmascript chunk logic to polyfill `global` with `globalThis`. A more complex and less performant solution (but with the benefit of us knowing the runtime environment) would be to add an effect for simple identifier expressions. * delete IsYarn util (vercel/turbo#2668) * feat(docs): new authors & consistent filesnames (vercel/turbo#2680) * Added caveat to environment variables docs (vercel/turbo#2703) Co-authored-by: Thomas Knickman <tom.knickman@vercel.com> * Fix publish workflow (vercel/turbo#2681) * change from yarn to pnpm (vercel/turbo#2686) Co-authored-by: Justin Ridgewell <justin@ridgewell.name> * Reverted workflow changes * Fixing tests. Added run args to base * Trying to fix tests * Rewrote some logic around run args handling * Fixing up tests by adding flags and fixing parsing bugs * Hooked up RepoState to Go code * Fixing e2e tests * Fixing e2e * Gotta build shim, not turbo in package.json * Patched integration test * Reverted Cargo.toml * Cargo.lock too * Fixing tests * Moving turbo binary to shim * Fixed tests and CI * Check for TURBO_BINARY_PATH * Ported shell completions to Rust * Fixed logic issue with TURBO_BINARY_PATH * Created .gitignore file with generated rust and header files * Second try on cleaning up generated files * More CI fixes * Realized we still need some inference * Removed files that are edited by run-examples.sh * Switched order of `cargo fmt --check` and `cargo clippy` because `cargo clippy` generates files needed for `cargo fmt --check`. * Cleaning up changes. * Fix one thing break another * Accept integration changes * Deleting more unused code * Test fixes * No longer need this line now that src/ffi.rs is gitignored * PR feedback * Update cli/internal/run/run.go Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com> * Fixing typo * Merged main * PR feedback * PR feedback * Merge main * Reverted workflow change * Error on invalid unicode instead of lossy conversion * PR feedback * Squashed commit of the following: commit 096b8b8b357abe985e4116108af8a87aaba968cb Author: David Barrat <david@barrat.io> Date: Mon Dec 5 15:29:41 2022 +0100 Docs: Add Authdog to Turbo Showcase page (vercel/turbo#2921) [Authdog](https://www.authdog.com/) is an Identity and Access Management as a Service platform, built upon Serverless technologies (AWS Lambda, Vercel, Fastly and Cloudflare Workers). I started looking for alternatives to Nx, some times ago and experimented with Turbo, decided to migrate some projects to this tool, awesome stuff! commit e39d65eb5b97140fe6338dabfbd0ac3be2987d8f Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 15:23:40 2022 +0100 enable id reusing (vercel/turbo#2895) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> commit 6b99818abd358ebb4fa3506b493e2fae34372d25 Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 15:22:53 2022 +0100 Reduce wrapper tasks by eagerly resolving Vcs (vercel/turbo#2933) * resolve codegenerateable before calling it * eagerly resolve some constructors to avoid creating many wrapper tasks Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> commit ce4c445cd2c17021b4397c8e3cf93d91921146ef Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 15:22:32 2022 +0100 Share TaskInputs between task cache and task (vercel/turbo#2923) Move bound task function into TaskState to allow unloading Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> commit e1bf5e2cde7ca2006c8a4c3455dec38e971aa3eb Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 14:32:24 2022 +0100 make sure that removing collectibles will cleanup helper entries (vercel/turbo#2872) commit 532eff76326fb9237a450345b45073c1061e5a37 Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 13:27:22 2022 +0100 Reduce the number of Strings and wrapper tasks (vercel/turbo#2834) * use Cow to avoid creating Strings for trait function names * trait calls avoid the resolve trait wrapper task when called on a resolved VC * eagerly resolve some Vc that would otherwise create a lot of wrapper tasks Depends on vercel/turbo#2416 commit dc36fc41586e5763520b4a16d249cdd6779bc902 Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 11:00:10 2022 +0100 reduce number of allocations (vercel/turbo#2833) VecDeque::new always allocates 7 elements commit 4f247be94b03f44765ac8bd334194545cd992b9b Author: Nathan Hammond <nathan.hammond@vercel.com> Date: Mon Dec 5 15:39:15 2022 +0800 Upgrade to Next.js 13 (vercel/turbo#2906) This gets our site updated to Next.js 13 and Nextra 2. As a bonus, this should help prevent some of the issues we're seeing in Sentry. commit 1e818068241c308cd3260bd83eba294d890a6151 Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Mon Dec 5 07:42:19 2022 +0100 shrink lists and sets that are stored in Tasks (vercel/turbo#2873) Reduces memory usage by 14% commit cac79bbe35c5ee7d2bf14625bb709dff8010b8ad Author: Ahab <ahabhgk@gmail.com> Date: Sun Dec 4 13:23:26 2022 +0800 make lazy bundling for dynamic import more lazy (vercel/turbo#2918) For example: ```js // index.js setTimeout(() => { import('./async.js').then(() => console.log('async.js loaded')) }, 1000) ``` ```js // async.js import './async.css'; console.log('async.js content') ``` For now the graph generated by above code will be like this: <img width="1461" alt="Screen Shot 2022-12-03 at 21 22 24" src="https://user-images.githubusercontent.com/42857895/205442932-ebfd5126-ef3d-4205-b5b5-434126ad46f7.png"> The `ChunkGroup_async` will be a async chunk group of `ChunkGroup_index`, pushed at [turbopack-core/src/chunk/mod.rs#L462](https://github.com/vercel/turbo/blob/e1a9bcb94d439856982fd7edb522ba3122699f2d/crates/turbopack-core/src/chunk/mod.rs#L462), and it will have a reference between `ChunkGroup_index` and `ChunkGroup_async`, but `ChunkGroup_async` will also be a chunk group of `ChunkGroup_async-manifest-chunk` created at [turbopack-ecmascript/src/chunk/loader.rs#L165](https://github.com/vercel/turbo/blob/e1a9bcb94d439856982fd7edb522ba3122699f2d/crates/turbopack-ecmascript/src/chunk/loader.rs#L165), and will have a reference between `ChunkGroup_async-manifest-chunk` and `ChunkGroup_async`. This leads to when the browser request '/_a8a837.js', turbopack will compile chunks in `ChunkGroup_index` ('/_a8a837.js'), `ChunkGroup_async-manifest-chunk` ('/src_async.js_manifest-chunk.js'), and also chunks in `ChunkGroup_async` ('/src_async.js', '/src_async.css'), because of the reference between `ChunkGroup_index` and `ChunkGroup_async`. But the expected behavior is only compile chunks in `ChunkGroup_index` and `ChunkGroup_async-manifest-chunk`, so this PR deleted the reference between `ChunkGroup_index` and `ChunkGroup_async`, makes the graph be like this: <img width="1461" alt="Screen Shot 2022-12-03 at 21 50 29" src="https://user-images.githubusercontent.com/42857895/205444165-7b266dce-9aa6-4829-b8dc-d2bf74642aff.png"> And makes chunks in `ChunkGroup_async` to be compiled only when the browser request '/src_async.js_manifest-chunk.js'. commit fd09f2e7cba7bcff030c1f10f31fc0155dd055fe Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 4 03:26:37 2022 +0000 chore(deps): update dependency @types/node to v18.11.10 (vercel/turbo#2928) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Thomas Knickman <tom.knickman@vercel.com> commit 429e91eae5c313556fe8cb0bde87ab521e28d7cf Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Dec 3 22:21:26 2022 -0500 chore(deps): update dependency @babel/core to v7.20.5 (vercel/turbo#2919) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit c2d5a07dc58a57434cf2aed00a1ce428215f585e Author: Tobias Koppers <tobias.koppers@googlemail.com> Date: Sat Dec 3 22:11:10 2022 +0100 update chromiumoxide (vercel/turbo#2916) updating in hope that this fixes the random errors in test runs commit e1a9bcb94d439856982fd7edb522ba3122699f2d Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Dec 3 08:54:50 2022 +0000 chore(deps): update rust crate futures to 0.3.25 (vercel/turbo#2915) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dev-dependencies | patch | `0.3.21` -> `0.3.25` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.21` -> `0.3.25` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.24` -> `0.3.25` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>rust-lang/futures-rs</summary> ### [`v0.3.25`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0325---2022-10-20) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.24...0.3.25) - Fix soundness issue in `join!` and `try_join!` macros ([#&vercel/turbo#8203;2649](https://togithub.com/rust-lang/futures-rs/issues/2649)) - Implement `Clone` for `sink::Drain` ([#&vercel/turbo#8203;2650](https://togithub.com/rust-lang/futures-rs/issues/2650)) ### [`v0.3.24`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0324---2022-08-29) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.23...0.3.24) - Fix incorrect termination of `select_with_strategy` streams ([#&vercel/turbo#8203;2635](https://togithub.com/rust-lang/futures-rs/issues/2635)) ### [`v0.3.23`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0323---2022-08-14) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.22...0.3.23) - Work around MSRV increase due to a cargo bug. ### [`v0.3.22`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&vercel/turbo#8203;0322---2022-08-14) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.21...0.3.22) - Fix `Sync` impl of `BiLockGuard` ([#&vercel/turbo#8203;2570](https://togithub.com/rust-lang/futures-rs/issues/2570)) - Fix partial iteration in `FuturesUnordered` ([#&vercel/turbo#8203;2574](https://togithub.com/rust-lang/futures-rs/issues/2574)) - Fix false detection of inner panics in `Shared` ([#&vercel/turbo#8203;2576](https://togithub.com/rust-lang/futures-rs/issues/2576)) - Add `Mutex::lock_owned` and `Mutex::try_lock_owned` ([#&vercel/turbo#8203;2571](https://togithub.com/rust-lang/futures-rs/issues/2571)) - Add `io::copy_buf_abortable` ([#&vercel/turbo#8203;2507](https://togithub.com/rust-lang/futures-rs/issues/2507)) - Remove `Unpin` bound from `TryStreamExt::into_async_read` ([#&vercel/turbo#8203;2599](https://togithub.com/rust-lang/futures-rs/issues/2599)) - Make `run_until_stalled` handle self-waking futures ([#&vercel/turbo#8203;2593](https://togithub.com/rust-lang/futures-rs/issues/2593)) - Use `FuturesOrdered` in `try_join_all` ([#&vercel/turbo#8203;2556](https://togithub.com/rust-lang/futures-rs/issues/2556)) - Fix orderings in `LocalPool` waker ([#&vercel/turbo#8203;2608](https://togithub.com/rust-lang/futures-rs/issues/2608)) - Fix `stream::Chunk` adapters size hints ([#&vercel/turbo#8203;2611](https://togithub.com/rust-lang/futures-rs/issues/2611)) - Add `push_front` and `push_back` to `FuturesOrdered` ([#&vercel/turbo#8203;2591](https://togithub.com/rust-lang/futures-rs/issues/2591)) - Deprecate `FuturesOrdered::push` in favor of `FuturesOrdered::push_back` ([#&vercel/turbo#8203;2591](https://togithub.com/rust-lang/futures-rs/issues/2591)) - Performance improvements ([#&vercel/turbo#8203;2583](https://togithub.com/rust-lang/futures-rs/issues/2583), [#&vercel/turbo#8203;2626](https://togithub.com/rust-lang/futures-rs/issues/2626)) - Documentation improvements ([#&vercel/turbo#8203;2579](https://togithub.com/rust-lang/futures-rs/issues/2579), [#&vercel/turbo#8203;2604](https://togithub.com/rust-lang/futures-rs/issues/2604), [#&vercel/turbo#8203;2613](https://togithub.com/rust-lang/futures-rs/issues/2613)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/vercel/turbo). commit 93222f2b22d43bd9c1d917350f810e5398ca9d49 Author: Anthony Shew <anthony.shew@vercel.com> Date: Fri Dec 2 16:36:55 2022 -0800 feat(docs): document topology outside of a task (vercel/turbo#2879) * Docs for topology outside of a task Documentation for behavior in vercel/turbo#2855! * Minor cleanup. * Some copy updates and add image. Co-authored-by: Thomas Knickman <tom.knickman@vercel.com> commit f8aaf81cb7c833f672001eb36d30d700e1cf6cc9 Author: Will Binns-Smith <wbinnssmith@gmail.com> Date: Fri Dec 2 16:32:35 2022 -0800 Link to Turbopack's architecture.md from CONTRIBUTING.md (vercel/turbo#2913) commit 07231701892cbca7b73e35bfb490f2514770628e Author: Thomas Knickman <tom.knickman@vercel.com> Date: Fri Dec 2 16:40:08 2022 -0500 feat(docs): add github (vercel/turbo#2912) commit c69298c4a31516129bb62263f163a1da9c5614da Author: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Fri Dec 2 11:58:55 2022 -0800 build(cargo): update swc_core, dependencies to resolve circular deps (vercel/turbo#2869) * build(cargo): bump up swc_core * build(cargo): unpin indexmap * build(cargo): update dependencies * style(cargo): adjust format commit 6965cb81ef5693b3e7a23e6a999be04d6590fad5 Author: Leah <github.leah@hrmny.sh> Date: Fri Dec 2 19:42:05 2022 +0100 set correct cwd for server renderer (vercel/turbo#2886) commit 934567015bc99eb8aa80311623e52ea924cbc424 Author: Leah <github.leah@hrmny.sh> Date: Fri Dec 2 18:27:02 2022 +0100 fix dynamic paths (vercel/turbo#2884) commit eead9063968a3b8571e3ba2c7a897522f890e2fc Author: Nathan Hammond <nathan.hammond@vercel.com> Date: Fri Dec 2 16:09:08 2022 +0800 Fix the missing links. (vercel/turbo#2707) This PR does three things: 1. Prevents double redirects by setting the correct destination the first time. 2. Redirects URLs accidentally recreated in the new scope. 🤦♂️ 3. Removes a catch-all to trigger any additional missing links to appear. Changes are easy to review commit-by-commit. commit b8c0c3c74636fd4b0586951011919bc05e1f651d Author: Nathan Hammond <nathan.hammond@vercel.com> Date: Fri Dec 2 14:37:03 2022 +0800 Update lint-staged behavior. (vercel/turbo#2904) Before vercel/turbo#2859: `eslint --quiet --fix` After vercel/turbo#2859: `pnpm run lint --quiet --fix --` => `eslint . --ext js,jsx,ts,tsx --quiet --fix --` After this: `eslint --ext js,jsx,ts,tsx --quiet --fix --` Removes the sneaky `.`. commit 336ea22098ff8825e83baa2561d8ec0acf5b52af Author: Nathan Hammond <nathan.hammond@vercel.com> Date: Fri Dec 2 08:33:21 2022 +0800 Add additional detailed warning message if no tasks were run. (vercel/turbo#2778) This is a quality of life improvement output log so that you don't have to tease it out from the overall run summary and the situation is more-apparent. commit dcb1ab33d1f9571177b9db51e3e0cbbbe8e021e1 Author: Leah <github.leah@hrmny.sh> Date: Thu Dec 1 21:02:33 2022 +0100 simplify `next-binding` (vercel/turbo#2899) commit 22c1440283ed4dfd1e310210108244c4c12d4c56 Author: Justin Ridgewell <justin@ridgewell.name> Date: Thu Dec 1 13:55:15 2022 -0500 Implement import.meta (vercel/turbo#2816) I chose to have the `import.meta.url` to have the relative project path on disk. Webpack makes it the absolute system path, but that would make the JS output system dependent and I didn't like that. Vite doesn't bundle and uses the browser's behavior, which is the dev server path. I'm splitting this from the in-progress PR to implement `new URL(…, import.meta.url)` support. That requires a bunch of changes to the analysis code and a new FS content source, so it's taking longer to ship. Fixes WEB-137. commit 75a7d1ea450cdaa629920464b509f3098997ae06 Author: Thomas Knickman <tom.knickman@vercel.com> Date: Thu Dec 1 11:40:15 2022 -0500 fix(examples): cra pnpm fix (vercel/turbo#2897) * Merged main * Reverting changes that snuck in * Fixing tests * Final fixes for tests * Moving shim to crates/turborepo * More refactoring * First pass at splitting up shim and cli * Fixing tests * Added detection for help flag so users can get help outside of a valid repo * Update crates/turborepo-lib/src/shim.rs Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com> * Update crates/turborepo/Cargo.toml Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com> * PR feedback and test fixing * Set process's cwd * Have to do inference even with TURBO_BINARY_PATH * Comments * PR feedback * Moved single_package back to RunArgs * Removed print * Fixing bugs * Fixing rust tests * fixing bug with verbosity and Go tests * add local turbo version checking * remove ffi inclusion * Fixed integration tests * Linting fixes * Integrated local_turbo_supports_skip_shim * Fixed bug with cwd and restored yarn.lock * Okay back to setting current_dir * Fixed bug with canonicalization * Removed print starting Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com> Co-authored-by: Florentin / 珞辰 <ecklf@icloud.com> Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com> Co-authored-by: Thomas Knickman <tom.knickman@vercel.com> Co-authored-by: Matt Pocock <mattpocockvoice@gmail.com> Co-authored-by: Mehul Kar <mehul.kar@vercel.com> Co-authored-by: Yota Hada <hadayota33@gmail.com> Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Commits on Dec 14, 2022
-
style(turbopack): clippy --fix (vercel/turbo#3014)
Easy clippy improvements via `clippy --fix`.
-
Add support for new URL (vercel/turbo#2944)
Implements `new URL('./path', import.meta.url)`, so that the referenced file acts as a static output file, and transforms the URL into to point to that file in the graph. This is, well, complicated. As you'll see in the comments, we have an "inert" asset that acts as a placeholder until the module chunking algorithm gives us access to a `ChunkingContextVc`. It's unfortunately not available when we're doing the file parsing, but we can insert a reference to that inert asset. That inert asset will eventually create a `UrlAssetChunk` instance, and with that we can finally generate the correct output path for the URL referenced file. We actually discussed whether this could use a `StaticAsset`/`StaticModuleAsset` (a `StaticAsset` can be inserted at parse time), but it turns out that won't give us the necessary control to generate the final `URL` instance. A `StaticModuleAsset` always outputs an absolute path as it's default export, and that just won't work when we're trying to reference the file in node SSR. Fixes WEB-142. Pending WEB-279 for full node SSR support. Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
Commits on Dec 15, 2022
-
build(next/core): allow to specify tls backend for reqwest (vercel/tu…
…rbo#2994) Implement / fixes WEB-306. We can't rely on default tls backend for reqwest and hope to work with every target platform we support, due to several constraints. Some target cannot use -sys (openssl-sys), and some can't build rustls due to trasnsitive dep support issue. PR creates explicit opt-in features for those and let upstream application can specify what they need. `next-dev` currently sets `native-tls` as default for the general dev workflow conveniences, but that doesn't mean we promote it as default feature set - next-swc, or other like standalone turbopack will configure features by themselves when build binaries for their own.
-
feat(mdx): initial turbopack-mdx asset (vercel/turbo#2979)
Implements / fix WEB-86. This PR is an initial attempt to support mdx natively inside of turbopack. It uses mdxrs (https://github.com/wooorm/mdxjs-rs) internally to interop - compile - mdx inputs into renderable ecma outputs. PR creates a new type of asset `MDXAsset`, and then let its extension (`.mdx`) can be consumed by turbopack. Since mdx is a variant of ecma asset to be rendered, it requires to perform all of the ecma transforms in the current running turbopack session. But since its AST is not compatible to plain swc (or ecma), it also cannot be passed into existing ecmaassets. MDXAsset does interop for those, by creating a virtualasset for the ecma once mdx is compiled into plain ecma. This might not be feasible appoarch and requires different way to chain asset types, something I'd like to address in this PR. I guess this will be needed for other types of assets in a long run - where input is not an ecma but requires ecma transforms (i.e vue, ng templates).
Commits on Dec 16, 2022
-
Fix flakey next-dev integration tests (vercel/turbo#3020)
Fixes WEB-259 This should address the known cases of flakiness in the next-dev integration test suite. Most notably, it wraps the call to `browser.new_page`, which not only opens a new tab, it also navigates to the destination and waits for it to load. It also: * Migrates test code to `anyhow::Result`, and adds `context` to the `new_page` call should it fail again. * Mitigates flakiness resulting from browser-side Jest timeouts by moving the circular correctness test to a new directory called `__flakey__`. These tests aren't run at all -- unfortunatley it's not possible to customize Jest's timeout with this particular version of `jest-circus-browser`. WEB-319 tracks updating this dependency, which hasn't been maintained in a while, unlike `jest-circus` itself. Test Plan: * [x] Run the Rust test suite in CI until confident there are no intermittent failures.
Commits on Dec 17, 2022
-
Remove chunk item source maps from the asset graph (vercel/turbo#3059)
In order to serve source maps with HMR updates, we (used to) reference a source map asset for every chunk item using the items version hash (see vercel/turbo#2464 and vercel/turbo#2474 for the headaches this can cause). This update changes that, so that a chunk becomes responsible for giving access to one of its item's source map. We already have the `GenerateSourceMap` trait which assembles the chunk's `Sectioned` source map from all chunk items, so why not just allow access to an individual section? Coupled with a `ContentSource` that can retrieve the chunk, we can then provide access to that chunk's current item source maps per request.
Commits on Dec 18, 2022
-
Load next config (vercel/turbo#2955)
Load next.config.js via turbopack-node Closes WEB-158 Co-authored-by: Justin Ridgewell <justin@ridgewell.name> Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
-
Fix nitpicks with load-next-config (vercel/turbo#3064)
Re: code review nits from vercel/turbo#2955
-
Fix source map tracing for HMR updates (vercel/turbo#3063)
HMR is handled via an `eval(newCode)`, and that eval will inherit the filepath of the currently running file (in our case, the chunk file that contains the runtime code). To properly trace, we need to know both the chunk and the item ids, so we trace via the correct item's source map. Thankfully, we can use the (underspecified) [`//# sourceUrl` ](https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/javascript/source-maps#use--sourceurl-to-name-evaluated-files-in-the-sources-tool) meta comment to name the file we're currently evaluating. That'll get used as the stack frame's file. We can then encode the chunk path and item id into the filename, and let next's stack tracing code handle the rest. This also fixes an off-by-one on the column. Source maps are 0-based, but the line/column of a file as displayed in an editor or dev tools are 1-based.
Commits on Dec 19, 2022
-
set
__NEXT_STRICT_MODE
(vercel/turbo#2878)and `__NEXT_STRICT_MODE_APP`
-
Add clap macros for is_next_dev_command (vercel/turbo#3073)
Seems vercel/turbo#2878 removed this accidentally
-
PostCSS support in next-dev (vercel/turbo#3065)
This adds the ability to add Source transforms on assets, which modify the source code of an asset before parsing. This adds postcss via node.js as first source transform. Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
-
Fix postcss nitpicks (vercel/turbo#3077)
Re: vercel/turbo#3065 It also fixes the gnarly stack trace error whenever the node code throws, but it doesn't look very pretty. Not sure how to handle it: <img width="1280" alt="Screen Shot 2022-12-19 at 3 46 56 PM" src="https://user-images.githubusercontent.com/112982/208519095-ec7ad539-5c23-4b95-bcc1-71ba30381e60.png">
Commits on Dec 20, 2022
-
@next/font/google: scope font names (vercel/turbo#3049)
Fixes WEB-341 This incorporates a digest of the font request into the name of the font-family defined in the stylesheet, used in the css class, and returned to the JavaScript importer. This makes font-family names returned from `@next/font/google` in stylesheets unguessable. Note that this implementation uses 8-character long hex digests compared to the 6-character version in Next.js+webpack. Test Plan: imported Open Sans as a symbol, verified that stylesheet is updated to reference both `@font-face` definitions and the css class rules with `font-family: '__Open_Sans_3b020fa1';`. Verified that exported js object `style.fontFamily` references the same.
-
Fixes
new URL()
during SSR (vercel/turbo#3021)A follow up to vercel/turbo#2944, which incorrectly rewrote the `new URL("…", import.meta.url)` to `new URL("…", location.origin)` during server rendering (which obviously doesn't have a `location` object). This PR accomplishes 2 things: - Splits dev server address binding from setting up the handler function - This is necessary so that we can determine the bound server address during devs retry attempts. - Propagates the server address through the `ExecutionEnvironment` to the `UrlAssetReference` I chose to pipe the server address through the `ExecutionEnvironment` instead of the `EnvironmentIntention`, because I don't fully understand the differences between them. It seems like we want it in the intention for the types of rendering, but a server address is really tied to the node process, so I don't know. Fixes WEB-318
-
-
add progress output to command line (vercel/turbo#3061)
add counting seconds when something is happening. Only starts to show when compilation takes more than 1s Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
-
handle dependencies reported by postcss (vercel/turbo#3091)
pass the dependencies reported by postcss to turbo-tasks-fs. We don't have a good mechanism to track dependencies back-timed, so we start watching some as soon we know about the dependencies (after postcss compilation) tailwind reports dependencies as directory + glob, so our globbing need some improvements to handle these globs reported by tailwind. e.g. tailwind will rerun when any file changed from the tailwind config `content` globs. fixes WEB-356 Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Commits on Dec 21, 2022
-
Fix server generation of 404 pages (vercel/turbo#3103)
Any `404.js` page would inject a `[...]` path into the server generation. The problem comes from the `pathname_for_path` function, which will extract the extension from that path. In this case, it leads to a basename of `[...` and an extension of `]`, breaking the `regular_expression_for_path` dynamic route parser. Unfortunately, our integration tests timeout when I try to write a basic test case for this, so it's not possible to test at the moment. I've manually verified. Fixes WEB-214
-
-
Avoid creating a new api node.js pool for every request (vercel/turbo…
…#3110) Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
-
-
Fix retrying when port already bound (vercel/turbo#3114)
#3021 [removed](https://github.com/vercel/turbo/pull/3021/files#diff-c6405fb94033af4296b1f72626fb990aaf76f645b6ed0f7812c56fcad719cf0eL304-L306) 1 level of error wrapping, and the unwrapping code was not updated to match.
Commits on Dec 22, 2022
-
-
Misc ContentSource changes (vercel/turbo#3120)
- Adds `details` to `SourceMapContentSource` - Fixes `ty` of `SourceMapContentSource` - Adds default `children` trait method that returns empty children
-
separate typescript with types from typescript transformed (vercel/tu…
…rbo#3118) fixes weird typescript errors caused by types being referenced by .ts files
-
Misc fixes to starting dev server (vercel/turbo#3121)
- The 10th attempt used to day "trying again" and then didn't try again because the iterator ended… - Swaps a nested `.map() == Some(bool)` for a `and_then` - Extracts into a helper function so code can early return without an `Option<Result>` wrapper.
Commits on Dec 23, 2022
-
Allow CombinedContentSource to need data without locking up (vercel/t…
…urbo#3124) Currently when an individual `ContentSource` inside a `CombinedContentSource` requests additional vary data, the combined source will treat that source as the winner of the query. But, sometimes the vary data is necessary to determine that the content is not found by this source. And if that's the case, we'll hit a 404 when we should actually keep iterating. This is exactly the case we're going to hit with redirect/rewrites. Redirects need to be the very first content source, and I also need query/header/cookie/hostname data in order to determine if a redirect applies. Without this, **every** request becomes a 404.
Commits on Jan 3, 2023
-
Refactor the Next SSG transform to handle the inverse operation (verc…
…el/turbo#2968) ## The original transform The original behavior of the Next SSG transform is to remove `getServerSideProps`, `getStaticProps`, and `getStaticPaths` from Next.js page files so they can be bundled for the client. This is what enables the following code to work properly without advanced tree shaking: ```jsx import db from "db"; import PostCounter from export default function Home(props) { return <>{props.posts.length} post(s)</>; } const postsPromise = db.getPosts(); export async function getStaticProps() { return { props: { posts: await postsPromise, }, }; } ``` The transform is able to remove both `getStaticProps` and all its exclusive, transitive dependencies, so this is what the client would see: ```jsx import PostCounter from "components/PostCounter"; export var __N_SSG = true; export default function Home(props) { return __jsx(PostCounter, { count: props.posts.length }); } ``` ## Adding the inverse operation However, to support proper HMR for these data exports, we need to be able to execute somewhat of an inverse operation: remove the default component export, but preserve all the rest. This allows Turbopack to bundle server-side only declarations, only re-rendering when one of these changes, instead of re-rendering on any server-side and client-side change. From our module above, the updated transform is now also able to generate the following: ```jsx import db from "db"; const postsPromise = db.getPosts(); export async function getStaticProps() { return { props: { posts: await postsPromise } }; } ``` As you can see, this module is no longer importing the `PostCounter`, which means re-rendering will not invalidate when that counter changes. However, if the "db" module changes, we will still be able to detect a change and re-render. ## Other notes * I renamed the transform from "next_ssg" to "next_transform_strip_page_exports". It's much more verbose, but hopefully also much clearer about what it does at a glance. * I took the liberty to clean up and comment some parts of the transform to make it more easily understandable (at least for someone like me, who hasn't written a lot of SWC code). I also fixed a few bugs and edge cases. * I brought over the tests from the transform in the Next.js and added a couple of them. * For now, only the `StripDataExports` filter is used. A future PR will build on this and @ForsakenHarmony's vercel/turbo#2949 PR to actually implement SSR/SSG HMR. ## Reviewing guide 1. The crux of the change is the move (and refactor) of the next ssg transform from https://github.com/vercel/turbo/pull/2968/files#diff-133d73657647ed793ca4782a73552650b32ad565094b1e0faf452ad58705499b to https://github.com/vercel/turbo/pull/2968/files#diff-d6442fa6af9b66e581f062739dd6de2419f5e8f6f3d97cfa63518c72b0a9ee3e. 2. I also added the [errors.rs](https://github.com/vercel/turbo/pull/2968/files#diff-0f308375da4179c0ea5a0fcbd99593b56d6020cd7dec1694ed08f392f1637c09) and [fixture.rs](https://github.com/vercel/turbo/pull/2968/files#diff-6e23f34483fc17a27dfc630edb455ea95e28d5cb350468c2ba01384fbc3c116a) tests. I adapted fixture.rs to execute on the two transform filters: data exports and default export. 3. Most of the tests in `tests/` are copied from https://github.com/vercel/next.js/tree/canary/packages/next-swc/crates/core/tests. The changes I made are: i. https://github.com/vercel/turbo/pull/2968/files#diff-774abee6a1bf139c9ce55e226bf15b52e56ea091170ee5d6295c191fd8d793c7: made this one symmetric for both strip data and strip default transforms. ii. https://github.com/vercel/turbo/pull/2968/files#diff-4792266a264dc67da93748d2c6522917f860527a689891bd5f8f4add9841e7f6 wasn't supported before AFAIK. iii. https://github.com/vercel/turbo/pull/2968/files#diff-a3b12adbce1dec40f39ff8af13ffecbe7f6963e21bc402cef6332ecf5018877e similar to i.
Commits on Jan 4, 2023
-
Page data HMR (vercel/turbo#3132)
Based on vercel/turbo#2968 This builds upon vercel/turbo#2968 and @ForsakenHarmony's work on data routes to enable page data HMR. Page data HMR is a bit more clever than it is in Next.js as we won't re-render a Node.js result for each page file update. Instead, thanks to the `StripPageDefaultExport` transform, there are three versions of the page chunks: * client-side (strips page data exports); * server-side (full); * data server-side (strips page default export). Instead of subscribing to the full server-side result, on hydration, the client-side page separately subscribes to: * client-side updates (already the case); * data server-side updates (new). This means that updating something that only affects the page component will only cause a client-side update and **no Node.js re-rendering**, while updating something that only affects the data will only cause a server-side update. ~~I'm marking this as a draft for now as there are still a few areas to test/investigate:~~ - [x] When something that is used in both the default page export and data exports is changed, this will cause *two* HMR updates: one data update, and one client-side chunk update. **The same case breaks in Next.js, where we will receive a client-side update, but no server-side update, ending up with an incorrect result.** - [x] Differences between `getStaticProps/getServerSideProps`, as well as `getInitialProps` (need to talk with @timneutkens about this) (see #44523) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Commits on Jan 6, 2023
-
Reorganize next_client and next_server modules (vercel/turbo#3182)
This is a straightforward chore PR to move next_client and next_server modules around, in order to make navigation and imports more predictable between them. I'm also planning to introduce a next_shared::context in a further PR, hence the changes.
Commits on Jan 9, 2023
Commits on Jan 10, 2023
-
fix(next-core): check axes for variable fonts only (vercel/turbo#3209)
Addresses an issue currently affecting non-variable fonts in which `next-dev` errors for non-variable Google fonts. This issue can be replicated by using `next dev --turbo` and using a Google font that isn't variable, like Hind. The problem is resolved by unwrapping axes only if the font is variable. Relevant issue: #44282 Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
-
-
Commits on Jan 11, 2023
-
Update Google font-data.json (2023-01-11) (vercel/turbo#3255)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
Commits on Jan 12, 2023
-
Make file paths shorter to fix windows build (vercel/turbo#3256)
I verified that CI works with this change. https://github.com/kdy1/turbo-windows-path-length/actions/runs/3889566103/jobs/6638025437 --- x-ref: #44760 x-ref: https://github.com/vercel/next.js/actions/runs/3888528533/jobs/6635975573 x-ref: https://github.com/vercel/next.js/actions/runs/3888528533/jobs/6635975680 x-ref: https://github.com/vercel/next.js/actions/runs/3888528533/jobs/6635976658
-
-
Add support for dynamic
import()
s on the server-side (vercel/turbo#……3193) This PR separates Turbopack's `runtime.js` into two: - the Browser/DOM implementation, which uses `<script>` and `<link>` tags for dynamically loading chunks; - the Node.js/CommonJS implementation, which uses `require` instead. ~~The two runtimes share a lot of code, but I'm not sure what's the best approach for sharing this logic, or even if we should, so for now they are two separate entities.~~ The shared code between the two runtimes is now in a separate file to avoid duplication. Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
add basic webpack loader support (vercel/turbo#3284)
add the minimum to run a simple raw-loader (see test case) * add `experimental.turbopackWebpackLoaders` to next.config.js * key is extension like `".mdx"`, value is an array of loaders like `["mdx-loader"]`
Commits on Jan 13, 2023
-
Fix deduplication when importing module statically and dynamically (v…
…ercel/turbo#3297) The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with vercel/turbo#3193's ability to load chunks on the server side, this fixes fixes WEB-381.
-
Implement
experimental.resolveAlias
map for next.config.js (vercel/……turbo#3298) Fixes WEB-416. This implements loading an alias map set as `experimental.resolveAlias` in `next.config.js`. Test Plan: Added an integration test.
-
Apply the next/dynamic SWC transform (vercel/turbo#3184)
This PR adds the next/dynamic SWC transform to the repo. This is copied over from the implementation in [](https://github.com/vercel/next.js/blob/f70a6bfb8635929feeecc92413da1fb2b651a18d/packages/next-swc/crates/core/src/next_dynamic.rs), with an additional mode for Turbopack. For now, it applies it to all sources files (excluding node_modules, but including embedded modules). I've refactored the Next transforms logic to make it more easily extendable in the future, and avoid creating more Vcs than absolutely necessary. This PR is the last item in the list of what's needed to support next/dynamic in development.
-
Add basic test for next/dynamic (vercel/turbo#3307)
This adds two basic tests for next/dynamic: * one ensures that SSR supports dynamic components; * the other ensures that SSR doesn't run when `ssr: false`.
Commits on Jan 16, 2023
Commits on Jan 17, 2023
Commits on Jan 18, 2023
-
rename turbopackWebpackLoaders to turbopackLoaders (vercel/turbo#3325)
since they don't have exactly the same API Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Commits on Jan 19, 2023
-
-
Install AsyncLocalStorage for appDir rendering (vercel/turbo#3374)
#44668 refactored Next's use of `AsyncLocalStorage`, and installs a "polyfill" of the API by patching the node import onto `globalThis.` Importantly, it's then used in the module scope during imports, so we need to install the polyfill early in the app rendering startup. Fixes vercel/turbo#3319
-
-
Basic @next/font/google integration test (vercel/turbo#3170)
This: * Implements a basic http server to mock returning a stylesheet from the Google Fonts API (**Note**: This importantly does *not* mock returning the font resources themselves, which are currently loaded by the browser. We should implement something to do this when we implement caching arbitrary http resources traced from `url()` and this is no longer loaded by the test browser) * Adds an integration test that asserts the basic shape of the JS object returned by font functions * ~Adds an integration test that asserts the browser correctly loads a font for the ascii unicode range, along with the appropriate `font-display`, variant, etc.~ Unfortunately `document.fonts` is not reliable with different font-display loading patterns as any of them can fall back. As noted, this does not mock responses from Google for the font resources themselves, which are currently loaded by the test browser. This means that we'll be dependent on this external service for passing integration tests until we implement caching of `url()`s in Turbopack. We should monitor the reliability of this test.
Commits on Jan 20, 2023
-
NodeProcessPool: implement debug mode for a single-process passing --…
…inspect-brk (vercel/turbo#3385) This implements a debug mode for spawning Node processes across multiple surfaces including `evaluate` and `get_renderer_pool`. It: * automatically limits concurrency to 1 process per pool * passes `--inspect-brk` to spawned Node process * sets the timeout to effectively-infinite duration Test Plan: set the value to true for the call to `get_renderer_pool` in render_static.rs and attached to a debuggable server renderer process.
-
Always mark styled-jsx as external to avoid duplicating with bundled …
…copies (vercel/turbo#3386) Fixes WEB-412. Previously, references to styled-jsx inserted by the swc transform would be bundled, which duplicated the copy required by next, which is external. This marks the dependency is to be resolved as external always. Test Plan: Verified in a small app that `<style jsx>` nodes result in a server-rendered response with the appropriate `<style>` tag in the head.
-
-
improve resolveAlias to allow conditions to allow to apply aliases to… (
vercel/turbo#3324) … client/server only
-
Introduce next-dev-tests to rebuild automatically on test input chang…
…es (vercel/turbo#3288) I verified that the crate is rebuilt if I make a change of inputs. Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
-
Update mdxjs and testing crates (vercel/turbo#3398)
This updates our `mdxjs` dependency to the tip of wooorm/mdxjs-rs#11, so that we can update it's `swc_core` dependency (it conflicts with ours). It also updates the `testing` crate to update it's `swc_common` dependency (also conflicting with ours), and makes it a workspace dependency.
Commits on Jan 21, 2023
-
Handle empty pageData during HMR (vercel/turbo#3412)
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
Commits on Jan 24, 2023
-
refactor content sources to avoid evaluating content before serving (v…
…ercel/turbo#3334) fixes WEB-141 This changes the ContentSource API. Before a ContentSource returned a tuple of specificity and content. Now it returns a tuple of specificity and a get_content function. The old way made it very inefficient to combine multiple ContentSource. All combined ContentSources were ask before, all returned specificity and content, and they are ordered after that. That required to compute all contents, even if it is not really used after ordering. Now we order specificity and a get_content function and only compute the content (by calling get_content) with the final result. It also changes how data needs are expressed in the `get_content` function. Instead of asking it over and over again with more data, it statically returns the needed data with `vary` and the `get` function is only called with that data. This is technically more limited than the old way, but one can workaround that if needed. But practically we probably never need that. On the other hand it improves the number of function calls, since the `vary` method is only called once and the `get` only once per request. Before data needs required at least 2 `get` calls per request.
-
Fix data requests for dynamic routes (vercel/turbo#3435)
In addition to the fix, I've extracted the path regex/params matching logic from `turbopack-node` to `next-core`. `turbopack-node` now only declares a value trait which `next-core` implements.
Commits on Jan 25, 2023
-
Update Google font-data.json (2023-01-25) (vercel/turbo#3463)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: wbinnssmith <wbinnssmith@users.noreply.github.com>
-
partially support next metadata (vercel/turbo#3464)
This adds support for metadata in pages and layouts. Full metadata support also needs support for implicit metadata with files named `icon.ico` etc. This PR also improves the test suite and adds a basic test case for app dir support
Commits on Jan 26, 2023
-
Update Google font-data.json (2023-01-26) (vercel/turbo#3479)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: wbinnssmith <wbinnssmith@users.noreply.github.com>
-
Handle routing by calling Next.js code (vercel/turbo#3446)
This implements routing by using a-yet-to-be-implemented API exposed by Next.js. The API follows something similar to: ```typescript type MakeResolver = (config: NextConfig) => Resolver; type Resolver = (IncomingMessage, ServerResponse) => Promise<void> | void; import { makeResolver } from "next/dist/..."; const resolver = makeResolver(nextConfig as object); // Later, once we have a request we'd like to route: // We don't care what the promise resolved to, we just want it to settle. await resolver(req, res); ``` The resolver can do 1 of 3 things with this: 1. ~~Return a redirect response~~ Removed 2. Return a rewrite response 3. Stream a middleware response > ~~1. Return a redirect response~~ <details> First, ensure a `x-nextjs-route-result: 1` header is present on the response. Then return a JSON encoded body: ```typescript { url: string, statusCode: u16, headers: Record<string, string> isRedirect: true } ``` The Rust server will then respond with a redirect using to the appropriate location. </details> > 2. Return a rewrite response First, ensure a `x-nextjs-route-result: 1` header is present on the response. Then return a JSON encoded body: ```typescript { url: string, headers: Record<string, string> } ``` The Rust server will use this updated URL to request content from our handlers. > 3. Stream a middleware response Ensure `x-nextjs-route-result` header **is not present** on the response. All headers will be sent back, and the body will be streamed back to the browser. - - - TODO: - ~~Do `headers` actually matter to a `redirect`~~ Yes? - ~~Does `statusCode` actually matter to a `rewrite`?~~ No - ~~We can't handle streaming body responses yet.~~ Mocked by buffering. Fixes WEB-228 Co-authored-by: JJ Kasper <jj@jjsweb.site>
Commits on Jan 27, 2023
-
Review fixes for Next routing (vercel/turbo#3501)
This completes a few review requests from vercel/turbo#3446.
-
@next/font/google: support setting a css variable for fonts (vercel/t…
…urbo#3505) Fixes WEB-501 Fixes vercel/turbo#3139 This adds proper support for the [`variable` property](https://nextjs.org/docs/api-reference/next/font#variable) when constructing fonts. This results in: * defining a selector in the css module for a classname defining the css custom property (css variable), whose value is the font family * adding a `variable` property to the resulting js object whose value is the classname used in the selector above Test Plan: Added an integration test.
-
enable and fix backtracing for fatal errors in tasks (vercel/turbo#3504)
Enables the anyhow backtrace feature to capture backtraces for errors too when `RUST_BACKTRACE` is enabled. When running in release mode compiling with `CARGO_PROFILE_RELEASE_DEBUG=1` is recommended to get debug info into the errors.
-
Handle 404 page when getStaticProps.notFound = true or the route is n…
…ot found (vercel/turbo#3448) This specifically supports the case where `getStaticProps.notFound = true` or a matching route is not found, but not the case where `getStaticPaths.fallback = false` and the route is not enumerated; This separate case will be implemented in another PR.
-
Handle getStaticProps.redirect (vercel/turbo#3497)
This PR adds support for returning `redirect: { destination, permanent, statusCode }` from `getStaticProps`.
-
Commits on Jan 28, 2023
-
Fix infinite loop caused by error page rendering (vercel/turbo#3525)
The new error paths introduced in vercel/turbo#3448 both write their outputs to `.next/server/pages/`, which conflicts with: - The main pages source - Each other The infinite loop is very fun: 1. We need a `NodeJsPoolVc` to render pages 2. To get a `NodeJsPoolVc`, you need to write your files onto disk - So a pool is dependent on the contents of those files 3. When we render an error page, we need to write those files to disk 4. The error page shares the same file entrypoint as the main page source So, to render an error, we write the entrypoint, which is shared with main source. This alone is pretty bad, because it will invalidate our page source's node pool (and kill those processes). But, the loop is triggered by a more subtle bug: When we write a file, we read it to see if the contents have changed. Writing creates a dependency on the read! So when the error page is written to disk, it invalidated the read we preformed when we wrote the main page. That invalidated the main page (and it's node pool), and so we rendered again. That wrote the main page's code to disk, invalidating the read of the error page performed when we wrote the error page. ♾️ (I'll be opening more PRs…)
-
add pageExtensions support to appDir (vercel/turbo#3510)
The previous PR vercel/turbo#3499 only implemented support for `pages` directory. The `app` directory previously had no validation at all, it's added with this PR. Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Commits on Jan 30, 2023
-
Align ids and data attributes with Next.js's redbox (vercel/turbo#3522)
Next.js's integration test suite depends on these ids and data attributes to select against items in running test pages. This gets us passing some of those tests.
-
@next/font/google: css variable followup (vercel/turbo#3514)
This addresses feedback from vercel/turbo#3505
Commits on Jan 31, 2023
-
Return a 404 status code when a data route is
.notFound
(vercel/tur……bo#3545) Returning a 404 status code is required for the client-side router to redirect to the error page.
-
css modules: use a terser selector format that requires less escaping (…
…vercel/turbo#3437) Fixes WEB-447. Previously, generated classnames would include literal `/` characters, which need escaping when generating selectors. While users should still escape selectors, this avoids it for this case and makes generated code easier to read. This format is also more aligned with what webpack-based css modules generates. This also removes the square character as a separator, since it breaks words and makes double-clicking for selection more difficult.
-
turbopackLoaders: accept basic loader options (vercel/turbo#3540)
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
Commits on Feb 1, 2023
-
font/google test: update cssmodule classnames (vercel/turbo#3568)
#3437 wasn't up to date with main when it was merged. Test Plan: CI
-
add worker condition to edge compilation (vercel/turbo#3549)
some packages expect `worker` or `browser` condition to work on edge runtime
-
Wrap CSS chunk items in a @layer (vercel/turbo#3542)
In Turbopack, as a consequence of our lazy compilation model, CSS chunks can contain duplicate CSS chunk items. This can cause issues with precedence. Take the following example: Initial CSS chunk: ```css /* ... */ /* chunk item A */ h1 { font-size: 2rem; } /* ... */ /* other chunk item */ h1 { font-size: 4rem; } /* ... */ ``` Dynamic CSS chunk (loaded after the first page load completes) ```css /* ... */ /* chunk item A */ h1 { font-size: 2rem; } /* ... */ ``` In this example, when the page first loads, the following rule will be applied: ```css h1 { font-size: 4rem; } ``` But as soon as the dynamic CSS chunk loads, the following rule will be applied instead: ```css h1 { font-size: 2rem; } ``` However, from the order of rules in the initial load, we know that the former should still apply. We can remedy this particular issue by wrapping each CSS chunk item into its own [`@layer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) (thanks @sokra for the idea!). This ensures that when a CSS chunk item is re-encountered at a later time, it is automatically de-duplicated thanks to the inherent CSS layering algorithm. This is not an issue in Next.js as we can't have duplicated CSS chunk items.
-
external node_modules for SSR (vercel/turbo#3361)
Adds resolve plugins (currently only running `after_resolve`, could add `resolve` later) Had to fix `ResolveResult::merge_alternatives` because it merged two external results into `Unresolvable`
Commits on Feb 2, 2023
-
improve error reporting for fatal errors (vercel/turbo#3550)
This adds the turbo-tasks function name as `context` of all fatal errors propagated from executing or reading turbo-tasks functions. That should help in debugging fatal errors.
-
Share request resolving logic between http and update servers (vercel…
…/turbo#3597) With the addition of the Next.js routing layer at the root of our content sources, we need the update server to also be able to follow Next.js rewrites, like the HTTP server. This requires the following: * Rewrites need to be able to indicate a source where to "resume" after rewriting. Otherwise, we would enter an infinite loop of the Next.js layer rewriting to the Next.js layer. * The resolving logic from `process_request_with_content_source` needs to be extracted into its own function, so it may be called both from the HTTP server (which expects fully resolved `ReadRef`s) and the update server (which needs a `VersionedContentVc`): this is where `resolve_source_request` comes in. Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
-
Commits on Feb 3, 2023
-
Move integration test entries to input/ (vercel/turbo#3590)
Moves all next-dev integration test code into a parent `input/` directory, like our snapshot tests. This prepares for introducing `issues` snapshots to next-dev integration tests. Test Plan: CI
-
initial work for compile-time evaluation (vercel/turbo#3495)
Allows to skip unreachable code based on compile-time constant conditions e. g. ``` if (!process.turbopack) { require("will-not-be-processed"); } ``` * add if() and process.turbopack fixes WEB-491 * Removes unreachable code fixes WEB-498 * evaluate some logical operations `&&`, `||`, `??`, `!` * fix arguments handling fixes WEB-529 * nested effects for function called with closures * handle closures when array methods are used fixes WEB-538 * evaluates `process.turbopack` fixes WEB-496
-
always allow to close the error overlay (vercel/turbo#3624)
It's difficult to test an app, if a single error blocks using the whole page. Therefore, error overlay should always be closeable.
-
add helper for walking a tree concurrently and deterministic (vercel/…
…turbo#3619) Similar to our `try_join` helper this adds a `try_flat_map_recursive_join` helper, which allows to async expand a tree structure into all nodes. It will call the async mapper function concurrently to allow parallelism. It will handle circular and duplicate references and return all nodes in a determinstic way (breath-first).
Commits on Feb 6, 2023
-
Support for getStaticPaths.fallback = false (vercel/turbo#3600)
Adds support for `getStaticPaths` returning `{ fallback: false }` by building out all static paths and checking whether the resolved path is included in that list. `buildStaticPaths` requires the `next.config.js` path, as well as other config options such as locale. I created WEB-546 to track being able to pass them to the handlers.
-
Update Google font-data.json (2023-02-06) (vercel/turbo#3614)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: wbinnssmith <wbinnssmith@users.noreply.github.com>
-
Import Next's CJS AsyncLocalStorage modules (vercel/turbo#3634)
The node evaluation always renders with `type: "commonjs"` and `require()` calls, so we'll always import the CJS files. But here we're importing the ESM files. That means we have 2 distinct instances of `requestAsyncStorage` in our node instance, and they cannot properly communicate with the other. Fixes WEB-543
Commits on Feb 7, 2023
-
Rename experimental.resolveAlias to experimental.turbopackResolveAlias (
vercel/turbo#3651) Following discussion at #45560, this renames `experimental.resolveAlias` to `experimental.turbopackResolveAlias` to make it clear that this option is only available in Turbopack. Test Plan: `cargo test -p next-dev-tests`
-
Export __N_SSG and __N_SSP from the error component (vercel/turbo#3574)
`export *` would be preferable once supported.
-
detect missing trait methods at compile time (vercel/turbo#3657)
Leaves the default implementations of a trait "in place" and implements the "cross-trait" resolving differently we get back the normal rust error messages when you don't have every method implemented 🎉
-
refactor ResolveResult to allow mixing special and assets in alternat…
…ives (vercel/turbo#3675) Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Commits on Feb 8, 2023
-
improve error reporting of JSON parsing (vercel/turbo#3676)
also make source context generation more reusable This adds a source context snippet of the JSON that failed parsing and the json path to the error. ``` An error occurred while generating the chunk item [project]/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json) at Execution of module_factory failed at Execution of JsonChunkItem::content failed at Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26 at nested.? 1 | { 2 | "nested": { | v 3 | "this-is": "invalid" // lint-staged will remove trailing commas, so here's a comment | ^ 4 | } 5 | } ```
Commits on Feb 9, 2023
-
Combine next.config.js Turbopack options into a nested object (vercel…
…/turbo#3689) This combines Turbopack-specific options into a nested object `experimental.turbopack`, exposing `loaders` and `resolveAlias` properties. x-ref: https://github.com/vercel/next.js/pull/45560/files/631b637f42757e20aabe84dc933527dc66b55173#r1098123643 Test Plan: Integration tests for loaders and resolveAlias.
-
Accept
next/font/google
as well as@next/font/google
(vercel/turb… -
set nextExport flag for page rendering (vercel/turbo#3717)
Otherwise `router.isReady` will never be true for pages without gSSP, gSP or gIP
Commits on Feb 10, 2023
-
share asset and chunking context between server, server data and clie…
…nt navigation (vercel/turbo#3738) This improves the performance for client-side navigation as it can reuse the modules from the initial navigation. Same for server data requests.
-
Enable HMR updates even when critical issues occur (vercel/turbo#3714)
This enables HMR updates, even when the update message also contains critical issues. There were some inconsistencies with the logic previously, so I'm not sure whether this fix is fully correct. More on that in PR comments.
-
fix incorrect segment path (vercel/turbo#3739)
fixes app dir with `/(basic)/about` routes
-
-
Add req.cookies to API requests (vercel/turbo#3695)
This PR does a little bit more than what it says on the box. Before, we were parsing URL queries and request headers, only to serialize them some other way afterwards. The reason why we were parsing headers and queries is because we sometimes need to filter them. However, we don't need that for router/page SSR/page API. This PR makes it so we avoid parsing on Turbopack's side through `rawHeaders` and `rawQuery`.
-
improve node_modules as externals handling (vercel/turbo#3736)
Run after_resolve with original request try to resolve original request with node.js options to determine if it can be external typescript extends need to resolve with bare node.js resolving to avoid custom resolve options add special pnpm logic to improve externals when pnpm is used
Commits on Feb 13, 2023
-
Add support for ctx.params in getStaticProps/getServerSideProps (verc…
…el/turbo#3696) Dynamic segments should be passed a single string, while catch-all segments should be passed a list of strings. Furthermore, ctx.params was previously undefined because we weren't passing it forward through the render options.
-
Issue Reporters (vercel/turbo#3707)
Big thanks to @jridgewell for helping me out with a number of Rust-isms with this change. This expands `handle_issues` and the `NextDevServerBuilder` to accept an arbitrary `IssueReporter` -- a trait implementing `report_issues` which receives captured issues to send somewhere. This replaces using a fixed `ConsoleUi` to send issues to stdout/stderr, though `ConsoleUi` now implements `IssueReporter` and is the default implementation of an issue reporter if no other is provided. It also moves the responsibility of detecting fatal errors out of `ConsoleUi` and into `handle_issues` itself. This lays the foundation for alternative reporters, such as a test reporter to snapshot or assert against issues emitted, or a newline-delimited JSON reporter for other tools to consume. Co-authored-by: Justin Ridgewell <justin@ridgewell.name> --------- Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
-
fix integration tests on windows (vercel/turbo#3737)
For windows it's important that the browser is dropped so that the test can complete. To do that we need to cancel the spawned task below (which will drop the browser). For this we are using a JoinSet which cancels all tasks when dropped.
-
Make stringify_str and stringify_module_id use Serialize (vercel/turb…
…o#3770) Both `stringify_str` and `stringify_module_id` are now simply `stringify_js`. We could skip this and go directly to `serde_json`, but this hides the dependency behind turbopack-ecmascript.
Commits on Feb 14, 2023
-
Split swc_core/allocator_node out of __swc_core_binding_napi (vercel/…
…turbo#3772) We only can use `turbo_malloc` in `next.js` without `swc_node_base` included
-
Fix the router when Next.js returns no result (vercel/turbo#3741)
I changed the return type of the Next.js router in #45668 to account for cases where the router does and does not find a matching rewrite.
-
Revert "Issue Reporters (vercel/turbo#3707)" (vercel/turbo#3796)
This reverts commit a8612abf5edbde3013d6fcf8845976f422cb2ffc. This commit makes the `turbotrace` hanging, x-ref: https://vercel.slack.com/archives/C02UJN0A1UL/p1676369060652879
-
fix export * warning for client pages (vercel/turbo#3795)
This gets rid of this warning when using a client component as page: ``` warning - [analyze] [project-with-next]/src/app/client/page.jsx unexpected export * export * used with module [project-with-next]/src/app/client/page.jsx which has no exports Typescript only: Did you want to export only types with `export type { ... } from "..."`? ``` * fix export * warning for client pages * Detect `__turbopack_export_value__` as CJS style exports * fix `__turbopack_cjs__` name * flag turbopackHelper in client proxy
-
Restore Issue Reporters (vercel/turbo#3803)
This restores issue reporters, addressing a bug that prevented turbo-trace from completing. This moves `ConsoleUiVc::new` into an async block to prevent it from stalling. Test Plan: Verify `cargo run --bin node-file-trace -- print path/to/my/app` no longer stalls.
Commits on Feb 15, 2023
-
Add support for CSS module composes: and fix CSS precedence issues (v…
…ercel/turbo#3771) Adds support for the CSS module `composes:` rule. This also fixes a large issue with our chunk ordering and CSS precedence, where the BFS order of our chunks did not match the expected topological ordering.
-
add CompileTimeInfo struct for passing compile time info (vercel/turb…
…o#3685) extracted from vercel/turbo#3670 Refactoring to allow to pass more compile time info next to the environment to modules. e. g. we want to pass `process.env.NODE_ENV = "development"` in future
Commits on Feb 16, 2023
-
-
-
Fix routing cases (vercel/turbo#3832)
This fixes 2 bugs that I've found: 1. If the `middleware.ts` file doesn't exist, then we get an unhelpful `unable to resolve relative "."` error during `next-edge` transition processing - This is fixed by not processing the `VirtualAssetVc` with the edge transition 2. If you're using an older Next version, then the router doesn't have a `type` field - Because the `type` field is empty, we hit neither the `rewrite` nor `none` cases and fall through to the middleware case, returning an empty response with no body. - This is fixed by treating `{ url: string, headers: … }` as `{ type: 'rewrite', url: string, headers: … }`
Commits on Feb 17, 2023
-
-
Use name-value tuples for headers (vercel/turbo#3848)
This is a small cleanup extracted out of the WIP `basePath` PR.
-
Update Google font-data.json (2023-02-17) (vercel/turbo#3850)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
make error overlay message scrollable (vercel/turbo#3861)
Before long messages would just be hidden: ![](https://uploads.linear.app/099ed59a-06c6-472f-9977-4798721bda90/6ea99100-27be-4192-adea-46ff2ed78cc8/860978fd-9ea5-456e-8c5a-48cecacf3e95)
-
Use IndexSet in IntrospectableChildrenVc (vercel/turbo#3853)
Another small cleanup stemming from the the `basePath` PR. Makes the introspection ordering consistent, which is a nice usability win. Co-authored-by: Alex Kirszenberg <1621758+alexkirsz@users.noreply.github.com>
Commits on Feb 21, 2023
-
add possible unknown mutation to objects and arrays (vercel/turbo#3882)
Before the static evaluation didn't consider the fact that objects and arrays can be mutated. So we can't just assume for sure that they have certain properties/items. Instead we add an unknown mutation alternative to handle that. This avoids `if(obj.prop)` to be replaced with `if(true)` when prop is initialized with true. It might be modified in future.
-
loaders: use pre-compiled loader-runner distributed with Next.js (ver…
…cel/turbo#3823) The benefit of this depends on #45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including #45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
-
Ensure next global is initialized correctly (vercel/turbo#3894)
This ensures our tests can run properly as they rely on the next global being present.
Commits on Feb 22, 2023
-
Update Google font-data.json (2023-02-22) (vercel/turbo#3905)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
Include chunk path in WithClientChunks (vercel/turbo#3910)
`WithClientChunksChunkItem` currently only includes paths to chunks' references, but not chunks themselves. Fixes WEB-621.
-
-
separate app and pages structure extraction from source generation (v…
…ercel/turbo#3912) We need to invalidate router node.js process when routes change for correctness In future we can pass the routes list to next.js instead of only invalidating @jridgewell We also need the separated structure for next build @alexkirsz
-
add process.env.NODE_ENV support (vercel/turbo#3670)
define process.env.NODE_ENV to development for next-dev define and set `process.turbopack` --------- Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
-
fix: allow HMR to recover from hydration errors (vercel/turbo#3805)
We now store react errors in the error overlay (hydration errors) and if the error overlay receives the "build ok" message after that it will hard reload the page to recover
-
Make
chunk_content_internal
parallel (vercel/turbo#3836)This switches the `chunk_content_internal` function from a sequential BFS to a parallel BFS (+ reverse topological sort at the end). I expected this to make some difference in performance, as traversing references in parallel can lead to better CPU usage (see vercel/turbo#3771), but in practice our benchmarks show no significant difference. Real apps might be a different story, but I didn't notice any particular performance improvement on vercel.com either. This implementation is not perfect (we're making more calls to `get_children` than strictly necessary), but I think it's enough to measure a potential performance improvement. Marking this as a draft for now as it's more complicated than the current implementation and there's no clear win to adopting this.
-
Support NeedData responses in SourceMap/SourceMapTrace ContentSources (…
…vercel/turbo#3907) This implements a new `ContentSourceProcessor` trait and `WrappedContentSource` struct that allows our `ContentSource`s to register some processor to transform the eventual `ContentSourceContent` that an inner `ContentSource` returns. Yah, it's a bit of a mouthful with lots of very similar sounding names. Essentially, the old `SourceMapContentSource` and `NextSourceMapTraceContentSource` wrapped some inner `ContentSource`, and would request content from them, and process that content into a source map JSON or trace JSON. But, they didn't implement the `NeedData` response, so it only supported very primitive inner content sources. This PR extracts that knowledge into a single `WrappedContentSource`, which will recursively wrap every `ContentSourceResult` until we land on a fully resolved `ContentSourceResult::Result`. At that point, it hands off the work to a `WrappedGetContentSource`, which performs the processing on whatever content is returned by the inner `GetContentSourceContent`. If you can't tell yet, I'm making the description intentionally verbose to highlight just how similar our struct/trait names are. Fixes WEB-614
-
Automatically apply babel-loader for apps with babel configs (vercel/…
…turbo#3862) This will automatically apply `babel-loader` to Next.js apps that include a babel configuration file alongside `next.config.js`. It requires the app to provide `babel-loader` itself. Test Plan: Added an integration test.
-
improve startup performance (vercel/turbo#3927)
lazy parse page config from pages this avoids to need to transform and parse all pages
Commits on Feb 23, 2023
-
-
update to 13.1.7-canary.28 (vercel/turbo#3931)
* add `@opentelemetry/api` alias * fix some renamed imports
-
disable bloom filter for now (vercel/turbo#3933)
it currently breaks because it imports `crypto` in edge environment which isn't allowed. We need to fix this properly eventually...
Commits on Feb 24, 2023
-
Update Google font-data.json (2023-02-24) (vercel/turbo#3942)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: wbinnssmith <wbinnssmith@users.noreply.github.com>
Commits on Feb 27, 2023
-
Automatic babel-loader followup (vercel/turbo#3944)
This: * Addresses feedback from vercel/turbo#3862 * Exempts VirtualAssets from webpack loaders. This addresses a bug where next-hydrate.tsx could not be read. * Adds `ModuleRuleCondition::ResourceIsVirtualAsset` to filter these --------- Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
-
Snapshot issues in next-dev-tests (vercel/turbo#3774)
This: * Adds issue snapshot support to next-dev-tests. This will allow us to assert that certain issues are raised in tests that require next-dev. * Extracts common snapshot code into a new crates, `turbopack-test-utils`, which is shared between snapshot tests and next-dev-tests. * Implements an issue reporter that emits issues in a channel to the the integration test code, where they are snapshotted. * Fixes an issue where next-dev tests that were not Next.js apps would emit non-fatal issues for a missing `pages/` directory. Co-authored-by: Justin Ridgewell <justin@ridgewell.name> --------- Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Commits on Feb 28, 2023
-
Update Middleware Routing (vercel/turbo#3930)
This accomplishes 2 things: - Moves the creation of the edge info onto the Next.js side - Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition. After this, an update to the Next.js side will enable middleware. Fixes WEB-623
Commits on Mar 1, 2023
-
feat(overlay): apply data-* header for the error desc (vercel/turbo#4015
) Partially resolves WEB-671. There are some test cases use `data-nextjs-dialog-header` to lookup its inner text to verify error output. Due to differences of error overlay layout between turbopack / next-dev, those 2 have different inner texts. PR applies a workaround, by introducing new data tag `data-nextjs-turbo-dialog-body`. Next.js upstream will need following update to utilize this tag in its test suites.
-
refactor asset identification (vercel/turbo#3999)
* add Asset::ident() as unique identifier of an Asset * add ChunkItem::ident() instead of ChunkItem::to_string() (ValueToString) * base `chunk_path` on AssetIdent instead of path only Motivation: We want to get rid of the `import "."` in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made the `Asset::path` unique, which would no longer be the case after using inner assets. Some parts of the code base relied on `Asset::path` being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique. After this PR `Asset::ident` is intended to be unique and allow to carry more information than only the path: * Query string (`module?query`) * Fragment (`module#fragment`) * Asset (additional wrapped assets by key value pairs) * Modifiers (additional transformations applied on the module, e. g. `chunks`, `client chunks`) * In future: Part (select a subpart of the module, e. g. only export abc, or the module evaluation, or some internal part)
Commits on Mar 2, 2023
-
fix(route_matcher): do not include empty segment (vercel/turbo#4037)
### Description Closes WEB-674 if a matcher tries to split path have a slash like `/x/y`, split gives a redundant empty segment `["", 'x', 'y']`.
-
refactor internal modules (vercel/turbo#4018)
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on vercel/turbo#3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
-
Capture console statements as one unit including stack trace (vercel/…
…turbo#4028) ### Description fixes the deduplication issue with multiple output
-
follow up changes from review (vercel/turbo#4051)
### Description Follow-up changes for vercel/turbo#4018 <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> - [x] Auto label
-
avoid bundling and execution of modules just of watching (vercel/turb…
…o#4053) ### Description * use completions to signal additional invalidations for evaluation * avoid adding these modules as runtime entries, since that will unnecessarily code generate, bundle and execute these modules * gets rid of the watch_files_hack ### Testing Instructions * change postcss.config, next.config.js, etc. -> changes will be reflected by the app and process restarts
-
Only handle issues in dev server (vercel/turbo#3891)
All issues from `source` are already handled here: https://github.com/vercel/turbo/blob/48d9918806c12acdd320ff5de6092c028247ada3/crates/turbopack-dev-server/src/lib.rs#L168 So no need to handle them multiple times
-
webpack loaders: implement
emitError
andemitWarning
(vercel/turb……o#3983) This implements webpack loader context api for `emitError` and `emitWarning`, each of which emit Turbopack issues at the appropriate error level. As with webpack’s implementation, `emitError` does _not_ cause builds to fail [0]. This uses next-dev issue snapshots (vercel/turbo#3774) to test that issues are emitted. [0] https://webpack.js.org/api/loaders/#thisemiterror --------- Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Commits on Mar 3, 2023
Commits on Mar 4, 2023
-
next/font: Align with Next.js integration test suite (vercel/turbo#4039)
This: * Adds a compile-time feature, `__internal_nextjs_integration_test`, which is set when building Turbopack for the Next.js integration test suite. * When built with `__internal_nextjs_integration_test`, expects the environment variable `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` to be set with an absolute path to a JavaScript file exporting a mapping of urls to stylesheet text. This is used in place of making real requests to Google Fonts. * Addresses some small bugs in next/font/google to bring the implementation in line with the urls generated by Next.js without Turbopack. * Changes classnames generated by next/font to use 6 character hashes, bringing it in alignment with Next.js without Turbopack. Test Plan: * Adjusted existing unit tests * In Next.js, `node run-tests.js -c 1 test/e2e/next-font/index.test.ts` ### Description <!-- ✍️ Write a short summary of your work. If necessary, include relevant screenshots. --> ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> - [x] Auto label
-
inject swc helpers (vercel/turbo#4060)
### Description This fixed the `_extends` is not defined issue.
Commits on Mar 6, 2023
-
Remove graceful failure handling in routing (vercel/turbo#3959)
The graceful failures mean it's easy to accidentally break the router without noticing.
-
Make in next.config.js optional (vercel/turbo#4080)
### Description Ensures `target` is optional to match vercel/turbo#46801 which removes the option. <!-- ✍️ Write a short summary of your work. If necessary, include relevant screenshots. --> ### Testing Instructions <!-- Give a quick description of steps to test your changes. -->
-
ci(workflow): fix build errors (vercel/turbo#4082)
### Description Minor fix for the daily next.js test runs.
-
fix module options in middleware (vercel/turbo#4083)
### Description allows to use jsx in middleware
Commits on Mar 7, 2023
-
place all pages in the same intermediate output directory (vercel/tur…
…bo#4081) ### Description The isolation is unnecessary and we can reuse files when we share directories ### Testing Instructions Open multiple pages without client-side navigation in multiple tabs concurrently.
-
improve and enable issue path handling (vercel/turbo#4017)
### Description adds the issue trace again, adds some basic descriptions e. g. to pages ### Testing Instructions snapshot issues [X] Auto label
-
revert workspace dependency to allow building correctly (vercel/turbo…
…#4103) ### Description Cargo always uses default features for workspace dependencies, so we can't use that here. See also comment. ### Testing Instructions ``` $ cargo tree -p next-binding -i openssl --target x86_64-unknown-linux-gnu -e features error: package ID specification `openssl` did not match any packages ```
-
next/font: Generate fallback fonts (vercel/turbo#4086)
This: * Generates and uses definitions for fallback system fonts to use in place of user fonts, or as they are loading. * Reads the font metrics file from the `next` package directly relative to the user's app. * Fixes a bug where `adjust_font_fallback` defaulted to `false` instead of `true`. * Begins to refactor next/font code to be more modular in anticipation of `next/font/local` support. * Changes `handle_resolve_error` to take an origin `FileSystemPathVc` instead of a `ResolveOriginVc` as this is all it used, and a resolve origin isn't always available.
Commits on Mar 8, 2023
-
disable issue_path again (vercel/turbo#4118)
### Description Performance is just too bad
-
fix assert alias (vercel/turbo#4114)
### Description typo, causing resolve failure
-
fix(turbopack): Update app-renderer (vercel/turbo#4102)
### Description This PR mirrors some related manifest changes in Next.js: #46881. ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
-
WEB-415: next/font/google: Use next's bundled font-data.json (vercel/…
…turbo#4111) This removes the duplicated (and possibly mismatching) font data file in favor of loading the copy bundled with next, using `load_next_json` introduced in vercel/turbo#4086. It also removes the associated workflow and generation script.
-
Commits on Mar 9, 2023
-
Merge
EcmascriptChunkUpdate
s before sending them to the client (ver……cel/turbo#3975) This diff: * introduces the `VersionedContentMerger` trait, which allows for merging the updates of versioned contents within the same chunk group; * implements this for `EcmascriptChunkContent`/`EcmascriptChunkUpdate`, turning them into `EcmascriptMergedChunkContent`/`EcmascriptMergedChunkUpdate`; * creates a new `ChunkList` asset which is capable of merging chunk updates of chunks within the same chunk group, and create such an asset for dynamic chunks (through manifest/loader_item.rs) and chunk group files assets. This fixes a bunch of edge cases related to HMR: * HMR of dynamic imports now works; * Chunks getting added/deleted/renamed now also works with HMR, since we're listening to updates at the chunk group level; * CSS chunks get reloaded in the right order, with respect for precedence. There are still known edge cases with HMR: * CSS chunks added through HMR are not inserted at the right position to respect precedence (WEB-652). * Update aggregation is disabled because we don't want a critical issue to stop all HMR (WEB-582) . This would be fixed by applying aggregated updates when dismissing the error modal, but there are some edge cases with this too (e.g. what happens when an HMR update also causes an error on top of an existing error).
-
fix app dir with latest next.js (vercel/turbo#4134)
### Description * [fix manifest for __ssr_module_mapping__](vercel/turbo@4abd873) * [add missing styled-jsx alias](vercel/turbo@d9b4a4d) ### Testing Instructions layout-playground
-
improve introspection (vercel/turbo#4135)
### Description Add more details to introspection and make it more robust to errors during introspection ### Testing Instructions go to http://localhost:3000/__turbopack__/
Commits on Mar 10, 2023
-
fix pathname for data requests (vercel/turbo#4149)
### Description | input file | HTML pathname | Data pathname | | ------------------ | ------------- | ---------------- | | index.tsx | / | .../index.json | | blog.tsx | /blog | .../blog.json | | pricing/index.tsx | /pricing | .../pricing.json |
-
feat(ecmascript): transform ts input with runtime flags (vercel/turbo…
…#4142) ### Description Another attempt to close WEB-659. The crux is same as previous PR, but attempt to change the location where it read config / bubble down the config values to the actual transform stage. Mainly, `enable_typescript_transform` is now accepting an option instead of boolean flag to down to `EcmaInputTransform::Typescript`, and `get_*_module_context()` reads the config value as needed.
-
avoid sending modules in parent for dynamic imports (vercel/turbo#4056)
### Description Keeps track of available modules when importing new chunk groups. Omits assets that are already available in the parent chunk group(s) when determining assets to be included in chunks. ### Testing Instructions Dynamic imports should not include modules that are already in the parent chunks <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> - [x] Auto label fixes WEB-599
Commits on Mar 13, 2023
-
-
Integrate next-* crates from Turbopack (#47019)
Update workspace cargo deps Update cargo deps to point to local workspace Ignore too-many-arguments warnings Fix clippy errors Update pnpm workspaces exclude integration tests from unit tests CI rust-analyzer settings add rust flags and env vars
-