Commit graph

270 commits

Author SHA1 Message Date
Donny/강동윤
348b7364a6
feat: Update swc_core to v0.92.10 (#66521)
### What?

Update `swc_core`

### Why?

To apply https://github.com/swc-project/swc/pull/9019

It's required to use `swc_ecma_parser/tracing-spans`.

### How?
2024-06-04 16:52:58 +02:00
Will Binns-Smith
b39ae62a3b
Update rust toolchain to nightly-2024-05-31 (#66428)
Depends on https://github.com/vercel/turbo/pull/8256
2024-06-01 03:37:04 +00:00
Tim Neutkens
f521cc8fc4
Revert "Reapply "Turbopack: Register react refresh exports in module factory (#8191)"" (#66322)
Reverts vercel/next.js#66298
2024-05-29 13:10:13 +02:00
Will Binns-Smith
d3a5e949a3
Reapply "Turbopack: Register react refresh exports in module factory (#8191)" (#66298) 2024-05-29 13:09:43 +02:00
Will Binns-Smith
f7d3733652
Update turbopack to turbopack-240528.2 (#66293)
This includes an update to lightningcss to 1.0.0-alpha.57

vercel/turbo#7986
vercel/turbo#8218
vercel/turbo#8222
2024-05-28 22:06:20 +00:00
Donny/강동윤
97c92a24f2
feat: Upgrade lightningcss (#66280)
### What?

Update `lightningcss` **crate**.

### Why?

x-ref: https://vercel.slack.com/archives/C04KC8A53T7/p1716896534206159

### How?
2024-05-28 13:49:01 -07:00
Tim Neutkens
216ce33b5b
Implement typeof window inlining for Turbopack (#66128)
## What?

Update: Implemented a feature in Turbopack for `typeof window` inlining:
https://github.com/vercel/turbo/pull/8211. Verified the changes in that
PR + this PR fix the test 💯


Turbopack upgrade:

* https://github.com/vercel/turbo/pull/8081 <!-- Alexander Lyon - add
support for upload speed / remaining in the cache upload step -->
* https://github.com/vercel/turbo/pull/7673 <!-- Alexander Lyon -
[turbo-trace] add additional filter modes for allocs over time -->
* https://github.com/vercel/turbo/pull/8191 <!-- Will Binns-Smith -
Turbopack: Register react refresh exports in module factory -->
* https://github.com/vercel/turbo/pull/8195 <!-- Donny/강동윤 - feat:
Remove lint for `grid-template-areas`" -->
* https://github.com/vercel/turbo/pull/8207 <!-- Benjamin Woodruff -
chore: Remove unused `base16` dependency and dead `hex` wrapper function
-->
* https://github.com/vercel/turbo/pull/8185 <!-- Tim Neutkens - Update
contributing guide to mention snapshot test updating -->
* https://github.com/vercel/turbo/pull/8211 <!-- Tim Neutkens - Add
option for inlining typeof window -->
* https://github.com/vercel/turbo/pull/8214 <!-- Will Binns-Smith -
Revert "Turbopack: Register react refresh exports in module factory
(#8191)" -->

---

Previous PR description::

Implements a failing test for issue #66058.
The test only fails when using Turbopack.

While digging into that issue I found that `typeof window` replacement
is either not applied or does not cause `import()` or `require()` to be
removed. In the reproduction that approach is used to load a particular
package only in Node.js and another only in the browser.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-05-26 12:25:40 +02:00
Alexander Lyon
f993ea3d04
add next-build-test binary / library (#64121)
This adds a new target in the next-swc package designed as an entrypoint
for collecting memory benches. Later PRs in the stack add a script to
run the benches and finally a manual-triggered CI step
2024-05-24 15:14:39 +02:00
Will Binns-Smith
5c9949386c
Update lightningcss to 1.0.0-alpha.56 (#66046)
To sync with Turbopack.

x-ref: vercel/turbo#8176
2024-05-21 18:28:59 +00:00
Will Binns-Smith
4ff11d0631
Turbopack: Implement next/font/local with BeforeResolvePlugin and show custom error message (#65870)
Depends on vercel/turbo#8165

This:
- Creates and uses a `BeforeResolvePlugin` to handle requests to
`next/font/local/target.css` instead of `ImportMapping` replacers
- Returns a `ResolveResultItem::Error` which includes a custom
`StyledString` describing the missing font file

Test Plan: `TURBOPACK=1 pnpm test-dev
test/e2e/app-dir/next-font/next-font.test.ts`
2024-05-20 15:46:19 -07:00
Donny/강동윤
138e45cf56
Update turbopack & swc_core (#65450)
### What?

* https://github.com/vercel/turbo/pull/8101 <!-- Tobias Koppers - fix
off-by-one bug while reading heaptrack files -->
* https://github.com/vercel/turbo/pull/8130 <!-- Tobias Koppers -
refactor memory tracking -->
* https://github.com/vercel/turbo/pull/8097 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.92.5` -->

Update swc_core.


### Why?

To keep in sync and fix styled-jsx issues

### How?

Closes PACK-3042

---------

Co-authored-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com>
2024-05-17 20:15:51 +02:00
hrmny
25b767eb84
feat(turbopack-ecmascript): use import attributes for annotations (#59370) 2024-05-16 02:58:43 +00:00
Will Binns-Smith
81d5daddf3
Turbopack: Remove EcmascriptChunkingContext (#65716)
Depends on vercel/turbo#8133. See that PR for rationale.
2024-05-15 15:51:08 +00:00
Tim Neutkens
ac6e41292b
Reapply "Implement Turbopack trace server bindings" (#65419) (#65527)
Applies #65419 with the latest version of Turbopack that uses a
different websocket library.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-3363
2024-05-13 18:59:59 +02:00
Tobias Koppers
a7ebbdef7e
Turbopack: new graph aggregation (#65206)
* https://github.com/vercel/turbo/pull/8082 <!-- Tobias Koppers - Graph
aggregation refactoring -->
2024-05-08 19:18:09 +00:00
Tobias Koppers
1e127abda4
update turbopack (#65503)
* https://github.com/vercel/turbo/pull/8073 <!-- OJ Kwon -
feat(webpack-loaders): support dummy span interface -->
* https://github.com/vercel/turbo/pull/8083 <!-- OJ Kwon - fix(webpack):
print resource, project path when relative calc fails -->
* https://github.com/vercel/turbo/pull/8094 <!-- Tim Neutkens -
Implement bindings for Turbopack trace server -->
* https://github.com/vercel/turbo/pull/8061 <!-- Tobias Koppers - reduce
memory usage in analyser -->
* https://github.com/vercel/turbo/pull/8077 <!-- Alexander Lyon - Remove
async-trait from a few crates -->
* https://github.com/vercel/turbo/pull/8102 <!-- Tobias Koppers - fix
memory counting without custom allocator -->
* https://github.com/vercel/turbo/pull/8096 <!-- Benjamin Woodruff -
turbo-tasks: Expand `<T as TaskOutput>::Return` values in macros -->
* https://github.com/vercel/turbo/pull/8105 <!-- Benjamin Woodruff -
turbopack-node: Use path.join for postcss loader -->
* https://github.com/vercel/turbo/pull/8099 <!-- Tim Neutkens - Replace
websocket with tungstenite for turbo-trace-server -->
* https://github.com/vercel/turbo/pull/8060 <!-- Donny/강동윤 - feat: Add
lint for `grid-template-areas` -->
* https://github.com/vercel/turbo/pull/8110 <!-- Tobias Koppers - fix
lockfile -->
2024-05-08 12:05:29 +02:00
JJ Kasper
aa51bedbbe
Revert "Implement Turbopack trace server bindings" (#65419)
This is failing to compile for some of our targets to reverting to
unblock CI

Reverts vercel/next.js#65410

Closes NEXT-3331
2024-05-06 11:25:38 -07:00
Tim Neutkens
b85210d64e
Implement Turbopack trace server bindings (#65410)
## What?

Implements support for running the Turbopack trace server, which is the
websocket server that powers https://turbo-trace-viewer.vercel.app/ when
using `NEXT_TURBOPACK_TRACING=1 NEXT_TURBOPACK_TRACE_SERVER=1`.

Currently you have to manually run the server through the Turbo
repository which in practice means that only people working on Turbopack
are able to run it.

With the bindings implemented anyone should be able to run the trace
server.

Note that the traces that come out of Turbopack are very low level,
they're meant for optimizing Turbopack like finding slowdowns / large
memory usage / optimizing performance.

However, it's useful for people that want to peek into why their
application is slow to compile. I.e. we've used
https://turbo-trace-viewer.vercel.app to investigate reports in #48748.

This PR adds support for `trace.log` by default, so if you add
`NEXT_TURBOPACK_TRACING=1 NEXT_TURBOPACK_TRACE_SERVER=1` it will
automatically select the `trace.log` for the current instance of
Next.js. You can only have one trace server running at the same time.

### `next internal` 

In order to support running the trace server standalone, which is useful
for investigating trace files other people have shared, I've added a new
subcommand `internal` that is not covered by semver / use at your own
risk. It's meant for internal tools that are useful to be bound to the
version of Next.js, the turbo-trace-server is a great example of that as
it has an internal binary format for storing data that needs to match
the trace.log file.

If you want to take a look at `.next/trace` instead the new `next
internal` subcommand can be used for that:

```sh
# Replace [path] with a path to a file.
next internal turbo-trace-server [path]
```

For example:

```sh
next internal turbo-trace-server ~/Downloads/trace
```

Currently the trace server does not support loading multiple files, just
hasn't been implemented yet. Once we can load two or more files we can
load both `.next/trace` and `trace.log` when
`NEXT_TURBOPACK_TRACE_SERVER=1` and support multiple paths passed to
`next internal turbo-trace-server`.


### Turbopack upgrade


PR includes a Turbopack upgrade:

* https://github.com/vercel/turbo/pull/8073 <!-- OJ Kwon -
feat(webpack-loaders): support dummy span interface -->
* https://github.com/vercel/turbo/pull/8083 <!-- OJ Kwon - fix(webpack):
print resource, project path when relative calc fails -->
* https://github.com/vercel/turbo/pull/8094 <!-- Tim Neutkens -
Implement bindings for Turbopack trace server -->


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-3328
2024-05-06 15:23:40 +00:00
Tim Neutkens
9ec37c120a
Upgrade Turbopack (#65320)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-3311
2024-05-04 13:18:08 +02:00
Tobias Koppers
77706b68a7
Turbopack: rename source map prefix (#64965)
### What?

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

### Why?

### How?
2024-05-01 05:21:50 +00:00
Tobias Koppers
49e561e30e
update turbopack (#65191)
* https://github.com/vercel/turbo/pull/8020 <!-- Tobias Koppers - Turbopack Tracing: show memory consumption -->
* https://github.com/vercel/turbo/pull/8029 <!-- Will Binns-Smith - Remove `can_be_in_same_chunk` -->
2024-04-30 16:59:44 +09:00
Donny/강동윤
0cd93b3a19
feat(turbopack): Handle fragments in requests (#64232)
# Turbopack

* https://github.com/vercel/turbo/pull/7935 <!-- Donny/강동윤 -
feat(turbopack): Handle fragment in requests -->

### What?

turbopack counterpart: https://github.com/vercel/turbo/pull/7935

### Why?

We need to fix build

### How?

Closes PACK-1006
2024-04-23 21:10:13 +02:00
OJ Kwon
372f00eb07
fext(next): extend next.config for mdxRs support options (#64801)
### What

Closes PACK-2978, requires https://github.com/vercel/turbo/pull/8005.

PR extends existing mdxRs config from accepting object as well in
addition to current boolean flag, mainly to allow to specify what kind
of markdown types will be used between gfm and commonmark.
2024-04-22 21:51:47 +00:00
Donny/강동윤
7552a7a0ef
build: Update swc_core to v0.90.33 (#64553)
# Turbopack

* https://github.com/vercel/turbo/pull/7992 <!-- hrmny -
build(turbo-repository): fix napi build with LLD -->
* https://github.com/vercel/turbo/pull/7765 <!-- Tobias Koppers - Drop
excessive cells after task reexecution -->
* https://github.com/vercel/turbo/pull/7955 <!-- Donny/강동윤 - chore:
Update `styled-jsx` -->
* https://github.com/vercel/turbo/pull/7987 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.90.33` -->

### What?

Update swc crates to
0f07acbc57

### Why?

To keep in sync.

### How?

Closes PACK-2968
2024-04-22 07:04:45 +00:00
Benjamin Woodruff
b7a84913be
update turbopack (#64686)
* https://github.com/vercel/turbo/pull/7995 <!-- Benjamin Woodruff - fix(turbopack-node) postcss.config.js path resolution on Windows  -->

(plus unrelated turborepo + CI changes)

This PR should not be cherrypicked into the 14-2-1 branch. Instead https://github.com/vercel/next.js/pull/64677 should be merged into that branch, as that PR contains only the one above Windows commit.
2024-04-17 15:41:06 -07:00
Tobias Koppers
064788fee3
fix HMR for cases where chunking changes (#64367)
* test case for https://github.com/vercel/turbo/pull/7947
* fix source map retrieval for HMR-updated assets

Closes PACK-2944
2024-04-16 12:36:41 +02:00
Tobias Koppers
3491417ac5
update turbopack (#64501)
* https://github.com/vercel/turbo/pull/7858 <!-- Tobias Koppers -
refactor GlobalCssAsset to fix dynamic import of css -->
* https://github.com/vercel/turbo/pull/7944 <!-- Will Binns-Smith -
Update lockfile for compatibility with next.js -->
* https://github.com/vercel/turbo/pull/7936 <!-- Tobias Koppers - fix
panic when searching an the root span -->
* https://github.com/vercel/turbo/pull/7959 <!-- Tobias Koppers - fix
missing async loader -->
2024-04-15 22:19:31 +02:00
Tobias Koppers
cbee70991f
update turbopack (#64347)
* https://github.com/vercel/turbo/pull/7409 <!-- hrmny - chore: add
parallel rust frontend and remove unused rust dependencies -->
* https://github.com/vercel/turbo/pull/7920 <!-- Tobias Koppers - remove
warning when there is no PostCSS config -->
* https://github.com/vercel/turbo/pull/7856 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.90.29` -->
* https://github.com/vercel/turbo/pull/7941 <!-- Tobias Koppers - fix
recursion cycle when having a cycle of dynamic imports -->
* https://github.com/vercel/turbo/pull/7943 <!-- Tobias Koppers - fix
HMR by removing chunks from chunk list hash -->
2024-04-11 19:16:27 +02:00
Tobias Koppers
6224b9e29f
Revert "build: Update swc_core to v0.90.30" (#64329)
Reverts vercel/next.js#63790
2024-04-11 11:47:50 +02:00
Donny/강동윤
02dd1e55f0
build: Update swc_core to v0.90.30 (#63790)
# Turbopack


* https://github.com/vercel/turbo/pull/7409 <!-- hrmny - chore: add
parallel rust frontend and remove unused rust dependencies -->
* https://github.com/vercel/turbo/pull/7920 <!-- Tobias Koppers - remove
warning when there is no PostCSS config -->
* https://github.com/vercel/turbo/pull/7929 <!-- Tim Neutkens - Remove
environment variables page from Turbopack docs -->
* https://github.com/vercel/turbo/pull/7926 <!-- Tim Neutkens - Remove
outdated section -->
* https://github.com/vercel/turbo/pull/7925 <!-- Tim Neutkens - Update
Turbopack CSS docs -->
* https://github.com/vercel/turbo/pull/7928 <!-- Tim Neutkens - Update
Next.js mention in Turbopack docs -->
* https://github.com/vercel/turbo/pull/7856 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.90.29` -->



### What?

Update SWC crates.

### Why?

1. To keep in sync
2. Prepare usage of source map range mappings.
https://github.com/getsentry/rust-sourcemap/pull/77

### How?



Closes PACK-2860
2024-04-11 00:09:18 +00:00
Tobias Koppers
dedf385450
update turbopack (#64257)
* https://github.com/vercel/turbo/pull/7912 <!-- Tobias Koppers - fix
edge condition in environment -->
* https://github.com/vercel/turbo/pull/7914 <!-- hrmny - feat: support
interop for namespace importing cjs function exports -->
2024-04-09 23:33:01 +02:00
Will Binns-Smith
3d3311b150
Update rust-toolchain to nightly-2024-04-03 (#64048)
Depends on https://github.com/vercel/turbo/pull/7874, which should be
merged first.

Test Plan: `cargo check`


Closes PACK-2903
2024-04-04 23:28:02 +00:00
Donny/강동윤
29d53c87ea
feat(next-swc): Pass names of side-effect-free packages (#63268)
### What?

Pass the names of side-effect-free packages specified in `experimental.optimizePackageImports`.

Turbopack counterpart: https://github.com/vercel/turbo/pull/7731

### Why?

Some packages like `@tremor/react` causes a problem without `optimizePackageImports`.

### How?

Closes PACK-2527
2024-03-29 06:28:48 +00:00
Tobias Koppers
ab5d0a2002
update turbopack (#63778)
* https://github.com/vercel/turbo/pull/7797 <!-- Tobias Koppers - fix
externals in side-effect optimized modules -->
* https://github.com/vercel/turbo/pull/7830 <!-- Tobias Koppers - Avoid
showing import map description in resolving issue when there is no
import map mapping -->
* https://github.com/vercel/turbo/pull/7833 <!-- Tobias Koppers - add
next.js trace format -->
* https://github.com/vercel/turbo/pull/7835 <!-- Tobias Koppers -
correct global start by first start time -->
* https://github.com/vercel/turbo/pull/7812 <!-- Will Binns-Smith -
Turbopack docs: Fix broken webpack loaders link -->
* https://github.com/vercel/turbo/pull/7847 <!-- Will Binns-Smith -
Turbo tasks: Reuse aggregation context and apply queued updates -->
* https://github.com/vercel/turbo/pull/7840 <!-- Tobias Koppers - add
concurrency corrected duration -->
* https://github.com/vercel/turbo/pull/7854 <!-- Tobias Koppers - fix
size_hint on count hash set -->
2024-03-27 20:09:08 +01:00
Donny/강동윤
6b6590592e
Update turbopack (#63541)
# Turbopack

* https://github.com/vercel/turbo/pull/7815 <!-- Tobias Koppers - fix
alias in getResolve -->
* https://github.com/vercel/turbo/pull/7796 <!-- Donny/강동윤 - Update
`swc_core` to `v0.90.24` -->
* https://github.com/vercel/turbo/pull/7775 <!-- Tobias Koppers - fix
single css chunks with import context -->
* https://github.com/vercel/turbo/pull/7776 <!-- Tobias Koppers - change
port of trace-server -->
* https://github.com/vercel/turbo/pull/7763 <!-- Tobias Koppers -
Tracing improvements -->
* https://github.com/vercel/turbo/pull/7813 <!-- Tobias Koppers - fix
webpack loader incorrectly calling custom_evaluate -->
* https://github.com/vercel/turbo/pull/7764 <!-- Tobias Koppers - fix
some small bugs in turbo-tasks that are required for GC -->
* https://github.com/vercel/turbo/pull/7816 <!-- Chris Olszewski -
chore: remove some unused imports -->
* https://github.com/vercel/turbo/pull/7823 <!-- OJ Kwon -
fix(sourcemap): update sourcemap, remove checker -->

### What?

Update SWC crates to
ad932f0921

### Why?

To keep in sync.

### How?



 - Closes PACK-2807
 - Closes PACK-2819

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2024-03-25 03:15:02 +00:00
Will Binns-Smith
8500eca982
Update Turbopack to turbopack-240321.3 (#63585)
Includes vercel/turbo#7800
2024-03-21 23:46:36 +00:00
Will Binns-Smith
aeafed9405
Turbopack: Fail when module type is unhandled (#63535)
This causes Turbopack to fail and communicate when a file with an
unhandled or unregistered extension is built.

Test Plan: `TURBOPACK=1 pnpm test-dev
test/development/basic/hmr.test.ts`


Closes PACK-2803
2024-03-21 00:36:01 +00:00
Tobias Koppers
14f16c7050
update turbopack (#63475)
* https://github.com/vercel/turbo/pull/7762 <!-- Tobias Koppers - avoid
panic -->
* https://github.com/vercel/turbo/pull/7750 <!-- Tobias Koppers - fix
ASSET_PREFIX -->
* https://github.com/vercel/turbo/pull/7761 <!-- Tobias Koppers -
process source maps from webpack loaders -->
2024-03-19 15:58:19 +01:00
OJ Kwon
e12535c706
build(cargo): bump up turbopack (#63429)
### What

fix test/development/acceptance-app/app-hmr-changes.test.ts.

Closes PACK-2765
2024-03-18 21:11:37 +00:00
Will Binns-Smith
aa13705514
Turbopack HMR: Log when more errors cause full page reload (#63220)
Turbopack HMR: Log when more errors cause full page reload

Depends on vercel/turbo#7715

This adds messaging when HMR updates fail because:

- An HMR update could not be applied, such as updating an anonymous
function component
- An update follows a server-rendered error

Test Plan: See now passing tests in the manifest

Closes PACK-2728
2024-03-15 16:51:02 -07:00
Donny/강동윤
92fbd7802c
build: Update turbopack (#63273)
# Turbopack changes

* https://github.com/vercel/turbo/pull/7726 <!-- OJ Kwon - feat(node): augment webpack loader's logger context -->
* https://github.com/vercel/turbo/pull/7729 <!-- Donny/강동윤 - Update `swc_core` to `v0.90.22` -->
2024-03-14 08:53:14 +00:00
Donny/강동윤
013ba06810
chore: Update swc_core to v0.90.21 (#63031)
### What?

- Update `swc_core` to fix performance regression caused by the creation
of the `tokio` runtime.

This PR practically reverts
https://github.com/vercel/next.js/pull/62441.

 - Apply various minifier bug fixes.

   - https://github.com/swc-project/swc/pull/8730
   - https://github.com/swc-project/swc/pull/8733
   - https://github.com/swc-project/swc/pull/8725
   - https://github.com/swc-project/swc/pull/8726
   - https://github.com/swc-project/swc/pull/8727

- Apply https://github.com/swc-project/plugins/pull/271 (Closes
PACK-2714)


### Why?

Someone reported a performance regression. See
https://github.com/swc-project/swc/issues/8708

### How?

Closes PACK-2693

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-03-13 17:11:43 +00:00
Tim Neutkens
8ef121dff5
Implement new runtime_type for Turbopack (#63212)
## What?

Implementation of https://github.com/vercel/turbo/pull/7711

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2791

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-03-13 16:16:57 +01:00
Donny/강동윤
3e6720c364
build: Update turbopack (#63229)
# Turbopack

* https://github.com/vercel/turbo/pull/7719 <!-- Tobias Koppers - accept
css files outside of the project as virtual assets -->
* https://github.com/vercel/turbo/pull/7661 <!-- Tobias Koppers - more
efficient node.js process startup -->
* https://github.com/vercel/turbo/pull/7720 <!-- Tobias Koppers -
generate correct async module handling for side effects optimization -->
* https://github.com/vercel/turbo/pull/7718 <!-- Donny/강동윤 -
fix(turbopack): Fix CSS Modules class name for lightningcss mode -->

### What?

Update tests to make CSS Modules of `lightningcss` work with CSS grids.

### Why?

`lightningcss` enforces the class name to end with `[local]`.

See: https://lightningcss.dev/css-modules.html#css-grid


### How?

Closes PACK-2731
2024-03-13 10:13:56 +00:00
Tobias Koppers
18547d5fd0
add support for assets in edge (#63209)
### What?

add support for `new URL(..., import.meta.url)` assets in edge. e. g.
needed for og-image.

### Why?

### Turbopack Changes

* https://github.com/vercel/turbo/pull/7712 <!-- Tobias Koppers - allow
to use full urls in browser runtime -->

Closes PACK-2725
2024-03-12 21:37:16 +00:00
OJ Kwon
11af8dd96f
build(cargo): bump up turbopack (#63205)
* https://github.com/vercel/turbo/pull/7696 <!-- Leah -
fix(turbopack-ecmascript): always create values from object
destructuring -->
* https://github.com/vercel/turbo/pull/7709 <!-- OJ Kwon - build(cargo):
bump up deps, resolve build failures

Resolves build failurs with recent transitive deps bump.



Closes PACK-2720
2024-03-12 21:50:10 +01:00
Donny/강동윤
d55699d5f7
feat(turbopack): Enable lightningcss for turbopack by default (#62565)
# Turbopack

* https://github.com/vercel/turbo/pull/7682 <!-- Will Binns-Smith -
Turbopack HMR: url-encode sourceURLs -->
* https://github.com/vercel/turbo/pull/7524 <!-- Donny/강동윤 -
feat(turbopack): Enable lightningcss for turbopack by default -->


### What?

Enable lightningcss by default, for `--turbo` mode.

### Why?

It's time to do it 😄 

### How?

Turbopack counterpart: https://github.com/vercel/turbo/pull/7524


Closes PACK-2600
2024-03-11 06:49:43 +00:00
OJ Kwon
42b42a6498
build(cargo): bump up turbopack (#63073)
### What

* https://github.com/vercel/turbo/pull/7684 <!-- OJ Kwon -
feat(resolve): skip alias to d.ts -->



Closes PACK-2702
2024-03-09 01:29:21 +00:00
Tobias Koppers
72d88c1596
app layouts/pages depend on shared main files (#63042)
### What?

avoid duplication of next.js internals in app dir

For the example/hello-world:

Before:

```
Route (app)                                          Size     First Load JS
┌ ○ /                                                15 kB           184 kB
└ ○ /_not-found                                      15 kB           184 kB
+ First Load JS shared by all                        169 kB
  ├ chunks/[project]__929616._.js                    85.2 kB
  ├ chunks/[project]_packages_next_dist_0f911b._.js  83.2 kB
  └ other shared chunks (total)                      230 B
```

After:

```
Route (app)                                          Size     First Load JS
┌ ○ /                                                15 kB           104 kB
└ ○ /_not-found                                      15 kB           104 kB
+ First Load JS shared by all                        88.9 kB
  ├ chunks/[project]_packages_next_dist_0f911b._.js  83.2 kB
  └ other shared chunks (total)                      5.7 kB
```


Closes PACK-2695

### Turbopack changes

* https://github.com/vercel/turbo/pull/7617 <!-- OJ Kwon -
feat(turbopack): add missing webpack context property -->
* https://github.com/vercel/turbo/pull/7676 <!-- Tim Neutkens -
Implement minify for Turbopack runtime file -->
* https://github.com/vercel/turbo/pull/7677 <!-- Tobias Koppers - add
FullContextTransition -->
2024-03-08 16:12:33 +01:00
Tim Neutkens
36e401ecc5
Enable minification for Turbopack (#62994)
## What?

Implementation for https://github.com/vercel/turbo/pull/7660. Enables
minification of browser files.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2742

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-03-08 08:11:50 +01:00