Commit graph

242 commits

Author SHA1 Message Date
Tobias Koppers
7e2173c092 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
2022-11-16 15:45:11 +01:00
Florentin / 珞辰
6225f75a06 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.
2022-11-14 18:10:08 +00:00
Tobias Koppers
886a86d98b retry launching browser in test suite (vercel/turbo#2695) 2022-11-14 15:32:54 +01:00
Tobias Koppers
5320ba564f update next.js to 13.0.3 (vercel/turbo#2677) 2022-11-14 10:57:59 +00:00
Tobias Koppers
32593ea30d 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
2022-11-14 10:35:06 +01:00
Alex Kirszenberg
9711a7ef4a Add profiling docs (vercel/turbo#2664)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2022-11-14 10:26:39 +01:00
OJ Kwon
af6d90d2b6 feat(next-dev): align devserver cli options to napi bindings (vercel/turbo#2653) 2022-11-11 17:42:32 -08:00
Tobias Koppers
00b15975bb clippy (vercel/turbo#2662) 2022-11-10 10:54:31 +01:00
Tobias Koppers
810508aed0 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
2022-11-09 21:04:57 +01:00
Tobias Koppers
3d690b2778 order routes by specificity (vercel/turbo#2614)
* bugfix source maps in app dir

* add specificity

static assets are preferred over dynamic matches
2022-11-08 17:44:57 +01:00
Tobias Koppers
b893baacf8 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
2022-11-07 17:51:35 +01:00
Justin Ridgewell
35ae595de5 Implement Ropes for shared string construction (vercel/turbo#2525) 2022-11-04 15:42:18 -04:00
OJ Kwon
26cfc649d6 refactor(next/dev): do not expose unsupported cli options (vercel/turbo#2586) 2022-11-03 13:44:23 -07:00
Justin Ridgewell
196ac9717c 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>
2022-11-03 16:28:47 +01:00
LongYinan
e08865cafd Merge turbo crate into cargo workspace (vercel/turbo#2577) 2022-11-03 23:01:50 +08:00
Alex Kirszenberg
e8c027ffb2 Use mimalloc in next-dev (vercel/turbo#2467) 2022-11-03 07:01:39 +00:00
Tobias Koppers
beed9fb626 add benchmark documentation and blog post (vercel/turbo#2492)
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>
2022-11-01 00:08:56 +01:00
OJ Kwon
36daa2bf52 feat(next/dev): allow to retry bind (vercel/turbo#2480) 2022-10-30 12:05:37 -07:00
Tobias Koppers
091af50322 add TURBOPACK_BENCH_PROGRESS to show captured values during bench (vercel/turbo#2490) 2022-10-29 18:13:39 +02:00
Alex Kirszenberg
9b5c2e39ea Simplify benchmark warmup (vercel/turbo#2483)
* Simplify benchmark warmup

* Update crates/next-dev/benches/mod.rs

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

* fmt

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2022-10-29 09:37:52 +02:00
Justin Ridgewell
9fc8c13877 Faster source map tracing (vercel/turbo#2426)
* 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>
2022-10-29 01:16:05 +02:00
Tobias Koppers
befc272a8c remove require hook (vercel/turbo#2473) 2022-10-29 00:24:25 +02:00
Tobias Koppers
f9fb452b32 improve startup and warmup of benchmarks (vercel/turbo#2463) 2022-10-28 21:56:33 +02:00
Tobias Koppers
69d98a5bde make sure to exit the process in case of errors during errors sending (vercel/turbo#2457) 2022-10-28 20:56:40 +02:00
OJ Kwon
2af748edd4 refactor(next/dev): reusable start_server (vercel/turbo#2455) 2022-10-28 09:41:46 -07:00
阿豪
5f00509321 chore: typo (vercel/turbo#2404)
* chore: typo

* Remove hot_module_replacement from snapshot tests

Re: vercel/turbo#2351

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2022-10-28 11:59:21 -04:00
Alex Kirszenberg
f2d661c0bb Fix large regression with turning ModuleRuleCondition::matches into a tt::fun (vercel/turbo#2450)
* Fix large regression with turning ModuleRuleConditionVc::matches into a tt::fun

* Remove Vcs from ModuleRule altogether
2022-10-28 17:53:13 +02:00
OJ Kwon
0d12445d6a refactor(next/dev): allow devserver args serializable (vercel/turbo#2446) 2022-10-28 08:28:04 -07:00
Allan
b12e0d8f46 Fix unnecessary question mark warnings (vercel/turbo#2443)
* 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>
2022-10-28 01:40:49 -04:00
Tobias Koppers
2e4f40ae31 prettier fixes (vercel/turbo#2436) 2022-10-28 00:39:56 -04:00
Alex Kirszenberg
eca1e994f1 Update Next.js dependency for the TP benchmark (vercel/turbo#2435) 2022-10-28 00:39:33 -04:00
Alex Kirszenberg
201259af94 More forgiving timeout when waiting for Node.js to connect (vercel/turbo#2417)
* More forgiving timeout when waiting for Node.js to connect

* 10ms -> 30s
2022-10-28 00:35:30 -04:00
Justin Ridgewell
d4cb480fca Source map tracing fixes (vercel/turbo#2402) 2022-10-27 21:30:30 -07:00
JJ Kasper
8788e1f7d1 Add Next.js require hook (vercel/turbo#2434)
This hook is needed to ensure we properly map compiled modules like `styled-jsx` correctly. 

x-ref: [slack thread](https://vercel.slack.com/archives/CGU8HUTUH/p1666824437456749?thread_ts=1666819473.031139&cid=CGU8HUTUH)
2022-10-27 22:19:47 +00:00
Will Binns-Smith
52da74e39d Implement nsObj helper from webpack tests and pass basic import test (vercel/turbo#2385) 2022-10-27 01:22:58 +02:00
Tobias Koppers
d80eb2e0a0 fix node.js 18.9 (vercel/turbo#302) 2022-10-25 10:19:03 +02:00
Tobias Koppers
9c352406ee sort errors by relevance (vercel/turbo#299) 2022-10-25 09:15:51 +02:00
Tobias Koppers
50ca47eb8f fix inconsistent asset writes (vercel/turbo#296) 2022-10-25 09:01:03 +02:00
Tobias Koppers
2bc7c10228 use error overlay in app layouts (vercel/turbo#294) 2022-10-25 08:33:16 +02:00
LongYinan
ce4a8ed6bb Fix format check (vercel/turbo#289) 2022-10-25 13:45:08 +08:00
Tobias Koppers
395dbc9402 improve node.js pool process error handling (vercel/turbo#287) 2022-10-25 07:05:16 +02:00
Alex Kirszenberg
7d6212b064 Use a TCP connection for IPC between Node and TP (vercel/turbo#251)
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.
2022-10-25 05:31:08 +02:00
Alex Kirszenberg
880205ef37 Fix bad merge (vercel/turbo#281) 2022-10-24 19:42:55 -07:00
Tobias Koppers
150155b741 expose assets from fallback page (vercel/turbo#280) 2022-10-24 19:39:47 -07:00
Justin Ridgewell
c2bb12d0bf Fix tracing of node_modules files not emitted by pages (vercel/turbo#249)
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>
2022-10-24 19:16:35 -07:00
Tobias Koppers
43d86a1bfa clippy (vercel/turbo#266) 2022-10-25 03:38:43 +02:00
Will Binns-Smith
dc74ca31c0 Create an app root layout if app/page.{js,tsx} exists but layout does not (vercel/turbo#264)
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.
2022-10-24 17:30:04 -07:00
Alex Kirszenberg
c8067af03f Fix fallback page error overlay (vercel/turbo#268) 2022-10-24 17:05:21 -07:00
Tobias Koppers
dca015b121 move feature detection to next.js (vercel/turbo#263) 2022-10-24 16:19:14 -07:00
Tobias Koppers
233b69d203 App CSS and fixes (vercel/turbo#246)
fix app layout transition
add global css support
2022-10-25 00:27:17 +02:00