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
* 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
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.
* 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
* 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>
Co-authored-by: Anthony Shew <anthony.shew@vercel.com>
Co-authored-by: Jared Palmer <jared@jaredpalmer.com>
Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
Co-authored-by: Matt Pocock <mattpocockvoice@gmail.com>
* Store the sourcemap::SourceMap directly, instead of encoding it
* Implement GenerateSourceMap trait and use it to retrieve live maps
* Cleanup and comments!
* Update safety comment
* Rename var
* Update snapshots
* Update snapshots
* Fix tracing errors in SSR
SSR has access to `EcmascriptChunkVc`, not `EcmascriptChunkContentVc`. Client gets access only to `EcmascriptChunkContentVc`
* Fix source map sources on client
Because the JS is nested in dirs, the source needs to be an absolute path.
Co-authored-by: Jared Palmer <jared@jaredpalmer.com>
* Fix unused question marks warnings
Fix some return types that were giving clippy warnings, mostly `needless_question_mark`.
Remaining warnings are either `too_many_arguments` or `type_complexity`.
* Fix unncessary let binding
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Instead of using stdout for communication between the Node.js process
and the Turbopack instance, this PR switches to a TCP connection.
Furthermore, stdout and stderr are now piped between the Node.js process
and Turbopack.
Because the static SSR renderer doesn't emit files that exist in
`node_modules` (because we take advantage of node's native `require`
resolution), any paths that traced into `node_modules` would output the
full file system path. It's just verbose and annoying.
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
This makes turbopack automatically create `app/layout.js` if
`app/page.js` exists, or `app/layout.tsx` if `app/page.tsx` exists, and
neither layout file already exists.
**Note that I'd prefer this issue to have info severity, but even with a
higher log level of info, the issue is never shown**. Filed vercel/turbo#265 to
track this.
Test Plan:
In a new `create-next-app`, opt into appDirectory and create
`app/page.js`. Run turbopack and verify:
* [x] the index page renders correctly
* [x] An issue with Warning level is logged notifying the user an
`app/layout.js` was created
* [x] `app/layout.js` is actually created with basic root layout
In a new `create-next-app`, opt into appDirectory and create
`app/page.tsx`. Run turbopack and verify:
* [x] the index page renders correctly
* [x] An issue with Warning level is logged notifying the user an
`app/layout.tsx` was created
* [x] `app/layout.tsx` is actually created with basic root layout
In a new `create-next-app`, opt into appDirectory and create
`app/page.tsx`. Also create a basic `app/layout.js` (note js layout with
tsx page). Add a custom `<title>` to the layout. Run turbopack and
verify:
* [x] the index page renders correctly
* [x] No issue is logged
* [x] No files are modified
* [x] The custom `<title>` is reflected.