Commit graph

2844 commits

Author SHA1 Message Date
vercel-release-bot
8f5f0ef141 v15.0.0-canary.56 2024-07-05 23:22:48 +00:00
vercel-release-bot
83a085acc7 v15.0.0-canary.55 2024-07-04 23:23:21 +00:00
Will Binns-Smith
a6631d994f
Turbopack + Relay: correctly implement artifact_directory to fix multi-project test (#67403)
Previously, if `artifact_directory` were set, artifacts would be
resolved at a fixed location relative to each file. This correctly
resolves them from the project root.

Test Plan: `TURBOPACK_BUILD=1 TURBOPACK=1 pnpm test-dev
test/integration/relay-graphql-swc-multi-project/test/index.test.js`

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-07-04 14:52:45 +00:00
Jiachi Liu
b369ccfcf4
Transpile geist by default (#67402)
### What

Transpile `geist` package by default. Currently users need to add
`geist` into `transpilePackages` to make it work with pages router as
it's external packages but require transform. This PR will resolve that
issue. cc @JohnPhamous

### Why

geist package is using `next/font` which requires to work with SWC
transform. But so far only ESM syntax can be captured by SWC since CJS
is pretty difficult to cover as the package import is not statically
analyzable.

We introduced a new list that it could be transpiled and include geist
package into bundle. Add it in both `next/jest` side and
webpack/turbopack bundling side

---------

Co-authored-by: 강동윤 (Donny) <kdy1997.dev@gmail.com>
2024-07-04 14:04:57 +02:00
vercel-release-bot
5c92390337 v15.0.0-canary.54 2024-07-03 23:23:51 +00:00
vercel-release-bot
b2625477c0 v15.0.0-canary.53 2024-07-03 05:25:20 +00:00
vercel-release-bot
747a60c311 v15.0.0-canary.52 2024-07-02 23:22:46 +00:00
vercel-release-bot
18c2fa85ab v15.0.0-canary.51 2024-07-02 13:16:34 +00:00
vercel-release-bot
6795597a50 v15.0.0-canary.50 2024-07-01 23:22:58 +00:00
vercel-release-bot
b9bd23baec v15.0.0-canary.49 2024-06-29 23:22:57 +00:00
vercel-release-bot
b1eab7fb5e v15.0.0-canary.48 2024-06-28 23:23:25 +00:00
vercel-release-bot
1441a353a9 v15.0.0-canary.47 2024-06-27 23:23:39 +00:00
vercel-release-bot
4b7924b155 v15.0.0-canary.46 2024-06-26 23:23:20 +00:00
vercel-release-bot
ce6ce9b04b v15.0.0-canary.45 2024-06-26 14:10:16 +00:00
Tobias Koppers
d4e349f79b
make next/dynamic visit more incremental and cacheable (#66912)
### What?

This makes extracting next/dynamic cheaper when modules have been visited before

### Why?

improved HMR and page transitions

### How?

All steps for visiting a module are extracted into a single cached function. VIsiting already visited modules costs only a single cache lookup
2024-06-26 11:11:13 +02:00
vercel-release-bot
90f564d376 v15.0.0-canary.44 2024-06-25 23:22:44 +00:00
vercel-release-bot
ea8020158e v15.0.0-canary.43 2024-06-24 23:23:43 +00:00
vercel-release-bot
6604c187ec v15.0.0-canary.42 2024-06-23 23:22:39 +00:00
vercel-release-bot
7f0102dcae v15.0.0-canary.41 2024-06-22 23:22:19 +00:00
vercel-release-bot
a7930c3c29 v15.0.0-canary.40 2024-06-21 23:22:06 +00:00
vercel-release-bot
32992fc0be v15.0.0-canary.39 2024-06-20 23:23:47 +00:00
vercel-release-bot
16f5c28cb3 v15.0.0-canary.38 2024-06-19 23:23:14 +00:00
Joost
50b9966ba9
Add sassOption implementation to support sass-embedded (#64577)
## What?
This PR adds an option to use `sass-embedded`.

## Why?
For large projects sass-embedded improves SCSS compilation time by over
50%.
See also https://github.com/vercel/next.js/discussions/36160

## How?
Added a sassOption `implementation` to configure the sass-loader which
Sass implementation to use.
See also https://www.npmjs.com/package/sass-loader#implementation

I think this a similar approach to what is done for `additionalData`.

## Additional notes
In order to support `sass-embedded`, `sass-loader` is upgraded to
12.6.0.

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-06-19 14:50:21 +00:00
hrmny
d02dfc6e05
feat(turbopack): add support for esm externals in app dir (#64918)
### What?
Writes the async flag to the client reference manifest to support ESM
externals in app dir.

The `app-ssr` context can't have esm externals as that might cause a
module to be async in ssr but not on the client.

Closes PACK-2967
Fixes #64525
2024-06-19 14:49:48 +00:00
vercel-release-bot
9889322d72 v15.0.0-canary.37 2024-06-18 23:23:07 +00:00
Tobias Koppers
7a9a0ccd2e
fix caching of client chunks (#66971)
### What?

cache wasn't well reused since all client chunks depend on the client
shared chunk, which had a different name for every page.
This fixes that and allows caching of all client component chunks
2024-06-18 16:41:53 +02:00
Donny/강동윤
e931ec671c
build: Update swc_core to v0.95.2 (#66902)
# Turbopack

* https://github.com/vercel/turbo/pull/8473 <!-- Donny/강동윤 - feat: Check
the number of direct dependants while tree shaking -->
* https://github.com/vercel/turbo/pull/8420 <!-- Tobias Koppers - Tree
Shaking grouping of items -->
* https://github.com/vercel/turbo/pull/8510 <!-- Tobias Koppers - read
larger chunks when reading a trace file -->
* https://github.com/vercel/turbo/pull/8509 <!-- Tobias Koppers - avoid
duplicates in primary_modules -->
* https://github.com/vercel/turbo/pull/8508 <!-- Tobias Koppers - only
create spans for nodes that are actually visited -->
* https://github.com/vercel/turbo/pull/8502 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.95.2` -->


### What?

Update `swc_core`.

- [CHANGELOG](064af5391d/CHANGELOG.md (160---2024-06-15))


### Why?

I improved the performance of the parser by margin.
2024-06-18 03:27:52 +00:00
Tobias Koppers
c9eab6ea7a
small memory and tracing improvement (#66899)
### What?

* reduce resolve tasks
* fix name for tracing
2024-06-18 04:34:27 +02:00
vercel-release-bot
83f21e98c5 v15.0.0-canary.36 2024-06-17 23:23:31 +00:00
Sebastian Silbermann
6282423fd7
Remove worker condition name when resolving files in the Edge runtime (#66808) 2024-06-17 18:00:23 +02:00
vercel-release-bot
e07b8b8e15 v15.0.0-canary.35 2024-06-16 23:23:54 +00:00
vercel-release-bot
3dba220b0b v15.0.0-canary.34 2024-06-15 23:22:41 +00:00
vercel-release-bot
5e30f86bc7 v15.0.0-canary.33 2024-06-15 18:23:39 +00:00
Tobias Koppers
70df7cfb01
[Turbopack] improve memory measurement suite (#66748)
### What?

* adds next-build-test to the workspace
* use multiple turbo-tasks root tasks to be more realistic
* add tracing support
* run pages in order
* add development mode with HMR
* updates for RcStr

### Why?

### How?
2024-06-15 10:04:29 +00:00
Benjamin Woodruff
0b1209edfa
Revert "Revert "Use turbo-tasks-malloc on all platforms" (#66884)", fix aarch64 compilation in CI (#66885)
We either need GCC >= 4.9 or we need to link with libatomic:
https://github.com/microsoft/mimalloc/issues/443

Unfortunately, manylinux2014-cross ships with GCC 4.8.5:
https://github.com/rust-cross/manylinux-cross/blob/main/manylinux2014/aarch64/Dockerfile#L71

We already appear to override the compiler toolchain in CI for x86_64 to
use clang (which is why mimalloc works there), so let's go ahead and do
that here too. This at least means we're using the same compiler across
both architectures.

I'm leaving the aarch64-musl codepath the same (using gcc) because (1)
we don't use mimalloc there yet and (2) it's a bit harder for me to test
as thoroughly.

# Testing

## Local Compilation

Run bash inside the docker image (I also had to install rosetta2 inside
my Linux VM, as this is an x86_64 image used for cross-compilation to
aarch64):

```
podman run --platform=linux/amd64 -t -i ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-aarch64 bash -l
```

```
git clone https://github.com/vercel/next.js.git --filter=blob:none --branch canary --single-branch
cd next.js
git checkout 6ae9828cce
```

Run the build locally:

```
apt update &&
apt install -y pkg-config xz-utils dav1d libdav1d-dev &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup show &&
rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
export CC_aarch64_unknown_linux_gnu=/usr/bin/clang &&
export CFLAGS_aarch64_unknown_linux_gnu="--target=aarch64-unknown-linux-gnu --sysroot=/usr/aarch64-unknown-linux-gnu" &&
cd packages/next-swc && npm run build-native-release -- --target aarch64-unknown-linux-gnu &&
llvm-strip -x native/next-swc.*.node &&
objdump -T native/next-swc.*.node | grep GLIBC_
```

Sanity check that the result is an aarch64 binary

```
$ file native/next-swc.linux-arm64-gnu.node
native/next-swc.linux-arm64-gnu.node: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, not stripped
```

## Verifying the binary works

Copy the next-swc binary into a copy of shadcn-ui I have sitting around:

```
podman cp 4e8f61b17965:/next.js/packages/next-swc/native/next-swc.linux-arm64-gnu.node ~/ui/node_modules/.pnpm/file+..+nextpack+tarballs+next-swc.tar/node_modules/@next/swc/native/next-swc.linux-arm64-gnu.node
```

and then try running the dev server and loading pages from it in the
browser:

```
pnpm --filter=www dev --turbo
```

## In CI


https://github.com/vercel/next.js/actions/runs/9523143080/job/26254016137
2024-06-15 03:39:24 +00:00
vercel-release-bot
d12b7a5d2a v15.0.0-canary.32 2024-06-14 23:23:00 +00:00
vercel-release-bot
6306ea3c1a v15.0.0-canary.31 2024-06-14 20:56:05 +00:00
JJ Kasper
fd9c524a72
Revert "Use turbo-tasks-malloc on all platforms" (#66884)
Reverting while we investigate further 

Reverts vercel/next.js#66815
2024-06-14 13:36:19 -07:00
Jiachi Liu
ce69888af1
Reland "Middleware to use react-server condition" (#66534) 2024-06-14 17:41:12 +02:00
vercel-release-bot
e4d107cc93 v15.0.0-canary.30 2024-06-14 15:05:15 +00:00
Benjamin Woodruff
a00146e001
Use turbo-tasks-malloc on all platforms (#66815)
This was previously disabled on `aarch64-unknown-linux-musl` and `wasm`,
due to compilation errors.
    
I moved the logic to disable `mimalloc` on these platforms into the
`turbo-tasks-malloc` crates in https://github.com/vercel/turbo/pull/8462
(which this PR depends on).
    
In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.

**Depends on:** https://github.com/vercel/turbo/pull/8462

Included turbopack changes:
* https://github.com/vercel/turbo/pull/8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* https://github.com/vercel/turbo/pull/8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* https://github.com/vercel/turbo/pull/8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* https://github.com/vercel/turbo/pull/8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* https://github.com/vercel/turbo/pull/8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* https://github.com/vercel/turbo/pull/8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* https://github.com/vercel/turbo/pull/8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* https://github.com/vercel/turbo/pull/8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
2024-06-14 04:56:04 +00:00
vercel-release-bot
c0b3c47059 v15.0.0-canary.29 2024-06-14 00:14:19 +00:00
vercel-release-bot
970420d78b v15.0.0-canary.28 2024-06-12 22:23:29 +00:00
Will Binns-Smith
33872bfa1e
Make InvalidImportResolvePlugin a BeforeResolvePlugin (#66622)
https://github.com/vercel/turbo/pull/8165 introduced plugins that
operate before resolving occurs, meaning that plugins like
`InvalidImportResolvePlugin` which never use the initial resolve result
and report issues can avoid that work.

Test Plan: `TURBOPACK_DEV=1 TURBOPACK=1 pnpm test-dev
test/development/acceptance-app/invalid-imports.test.ts`
2024-06-12 22:15:33 +00:00
Sam Ko
e296846427
chore: bump turbo to 2.0.3 (#66784)
## Why?

This pull request bumps turborepo from 1.13.3-canary.2 to
[2.0.3](https://github.com/vercel/turbo/releases/tag/v2.0.3) across
multiple GitHub workflows and configuration files.

Re-attempting after we
[reverted](https://github.com/vercel/next.js/pull/66775).
2024-06-12 19:31:42 +00:00
Tobias Koppers
4398e348ee
use node js chunking context for evaluation (#66710)
### What?

Refactoring to use node.js chunking context for evaluation

see https://github.com/vercel/turbo/pull/8402

### Why?

### Turbopack changes

* vercel/turbo#8422
* vercel/turbo#8402
2024-06-12 10:38:28 +00:00
vercel-release-bot
0cce20d50a v15.0.0-canary.27 2024-06-12 01:55:32 +00:00
JJ Kasper
d22da49b49
Revert "chore: bump turbo to 2.0.3" (#66775)
Seems the latest turbo version is causing issues with our rust
compilation so reverting for now

Reverts vercel/next.js#66762
2024-06-11 18:17:06 -07:00
vercel-release-bot
03b5267bdb v15.0.0-canary.26 2024-06-11 23:22:38 +00:00
Sam Ko
561dcf6c43
chore: bump turbo to 2.0.3 (#66762)
## Why?

This pull request bumps turborepo from 1.13.3-canary.2 to
[2.0.3](https://github.com/vercel/turbo/releases/tag/v2.0.3) across
multiple GitHub workflows and configuration files.
2024-06-11 22:28:01 +00:00