Commit graph

135 commits

Author SHA1 Message Date
Tobias Koppers
33b8e6157f
change static path to /_next/static/media (#50207)
### What?

align output path of turbopack and webpack

### Why?

passing test cases

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5072 <!-- Tobias Koppers -
improve asset path -->
2023-05-23 18:39:27 +02:00
Tobias Koppers
3d40cb01ab
refactor webpack loaders (#49535)
### What?

* allow to apply existing pipeline
* change webpack loader key to glob for more flexibility
* add test cases
* add special error message when using the old config syntax

Old config:

```js
experimental: {
 turbo: {
  loaders: {
   ".mdx": ["mdx-loader"]
  }
 }
}
```

New config

``` js
experimental: {
 turbo: {
  rules: {
   // key is a glob now
   // normal syntax will treat the result as ecmascript code
   "*.mdx": ["mdx-loader"],
   // glob allows more advanced matching
   "./images/**/*.png": {
    loaders: ["image-optimize-loader"],
    // result of loader will be handled in other steps
    // under the same name/path (here .png)
    // This will use the existing .png pipeline (static asset)
    // It might also use other rules matching .png.
    as: "*"
   },
   "*.generate-image.js": {
    loaders: ["image-generation-loader"],
    // It also possible to pass this under a different name
    // into the pipeline. Here it will treat the result as png image
    as: "*.png"
   }
  }
 }
}
```

### Why?

More flexibility and allowing to use the builtin module handling over
non-js types.

fixes WEB-1009

### Turbopack changes

* https://github.com/vercel/turbo/pull/4955 <!-- OJ Kwon -
refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled*
-->
* https://github.com/vercel/turbo/pull/4880 <!-- Tobias Koppers -
refactor webpack loader execution -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-23 17:21:25 +02:00
Tobias Koppers
df85ad1ec0
add tracing for turbopack (#49920)
### What?

adds `NEXT_TURBOPACK_TRACING` env var to enable tracing. Writes into `.next/trace.log`

There are 4 presets:

* `NEXT_TURBOPACK_TRACING=overview` gives a overview of requests and modules processed.
* `NEXT_TURBOPACK_TRACING=next` above plus details for next.js
* `NEXT_TURBOPACK_TRACING=turbopack` above plus details for turbopack
* `NEXT_TURBOPACK_TRACING=turbo-tasks` above plus details for turbo-tasks

Published release builds will only allow `overview` to work, since all detailed instrumentation is statically disabled.

see https://github.com/vercel/turbo/pull/4966 for more details

### Why?

get more insight into build times

### Turbopack changes

* https://github.com/vercel/turbo/pull/4995 
* https://github.com/vercel/turbo/pull/5049 
* https://github.com/vercel/turbo/pull/5053 
* https://github.com/vercel/turbo/pull/4966
2023-05-23 05:25:56 +00:00
Donny/강동윤
a5af56eda1
Update swc_core to v0.76.18 (#50137)
### What?

This PR disables `tracing/max_level_info`.

### Why?

Requested at
https://vercel.slack.com/archives/C03EWR7LGEN/p1683789628715199?thread_ts=1683738076.476839&cid=C03EWR7LGEN


### How?

Closes WEB-1080
Fixes #49949

Turbopack counterpart: https://github.com/vercel/turbo/pull/5049
2023-05-22 11:05:17 +02:00
Justin Ridgewell
448b74291e
[turbopack]: Update renamed SubpathValue (#49636)
https://github.com/vercel/turbo/pull/4895 renamed `ExportsValue` into
`SubpathValue`

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-19 18:46:10 +02:00
OJ Kwon
eb2650ae68
build(cargo): update turbopack (#50013)
<!-- 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 or adding/fixing 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 #

-->

This PR updates turbopack to the latest.
2023-05-19 02:03:18 +00:00
Alex Kirszenberg
051c90d43c
Introduce NextMode (#49852)
This introduces a `NextMode` enum that controls which mode Next.js Turbo
is currently running in:
* `NextMode::Development`: `next dev`
* `NextMode::Build`: `next build`

Requires https://github.com/vercel/turbo/pull/4972

This also update Turbopack to `turbopack-230517.2` with the following
changes:

* https://github.com/vercel/turbo/pull/4972 <!-- Alex Kirszenberg -
Configure React development flag, inherit NODE_ENV from execution
context -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-17 16:22:50 +02:00
Donny/강동윤
e5ad96edd5
chore(turbopack): Update swc_core to v0.76.6 (#49792)
### What?

Updates `swc_core` to `v0.76.x`, which adds support for `Explicit Resource Management` (stage 3)

### Why?

It's stage 3

### How?

Closes WEB-1040


---

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

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-05-16 05:08:17 +00:00
Leah
aeed1c770a
add support for globally providing mdx components to turbopack (#49818)
### What?

Adds support for `mdx-components` at the root/src directory.
This is a feature `next-mdx` already has:
https://github.com/vercel/next.js/tree/canary/packages/next-mdx#usage-1

Fixes WEB-1012

Depends on https://github.com/vercel/turbo/pull/4944

### Turbopack updates

* https://github.com/vercel/turbo/pull/4949 <!-- OJ Kwon -
refactor(turbopack): deprecate single react_refresh options -->
* https://github.com/vercel/turbo/pull/4944 <!-- Leah - add mdx
`providerImportSource` option -->
2023-05-16 00:45:08 +00:00
OJ Kwon
a7601213ab
refactor(next-core): consolidate react_refresh options (#49822)
<!-- 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 or adding/fixing 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



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

WEB-1049. Removes separate enable_refresh options.
2023-05-15 19:31:42 +00:00
Leah
138a795263
turbo-binding -> turbopack-binding (#49816) 2023-05-15 17:02:25 +00:00
OJ Kwon
cad6d3aa22
refactor(next-core): deprecate custom_ecmascript_transforms (#49629)
<!-- 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 or adding/fixing 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



### Why?

### How?

Closes NEXT-
Fixes #

-->



### What?

WEB-1031.

Deprecate old custom_ecmascript_transforms, consolidate to use
ecmatransforms_plugin instead.
Requires https://github.com/vercel/turbo/pull/4886 .

---------

Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
Co-authored-by: Leah <github.leah@hrmny.sh>
2023-05-12 19:43:25 +00:00
Tim Neutkens
684abdc5ce
Add trace-to-jaeger to workspace (#49692)
## What?

I wasn't able to `cargo run` in trace-to-jaeger because it wasn't in the
workspace.

<!-- 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 or adding/fixing 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 #

-->
2023-05-12 12:28:41 +02:00
Alex Kirszenberg
34f551d9b7
Rename Turbopack/tasks crates to common prefixes (#49446)
See https://github.com/vercel/turbo/pull/4866

This also updates Turbopack to turbopack-230511.2 with the following
changes:

* https://github.com/vercel/turbo/pull/4636 <!-- Alex Kirszenberg - Add
support for logging events and intervals in the macOS profiler -->
* https://github.com/vercel/turbo/pull/4793 <!-- OJ Kwon - ci(workflow):
enable more test -->
* https://github.com/vercel/turbo/pull/4886 <!-- OJ Kwon -
refactor(ecmascript-plugins): update serverdirective signature -->
* https://github.com/vercel/turbo/pull/4866 <!-- Alex Kirszenberg -
Rename Turbopack/tasks crates to common prefixes -->
2023-05-11 11:34:36 +00:00
OJ Kwon
1ed7544696
refactor(next-core): remove ast cloning in custom transform (#49560)
### What?

- closes WEB-1024.

Minor refactoring to avoid explicit AST cloning. Still visitors are
using fold though.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4869
* https://github.com/vercel/turbo/pull/4879
* https://github.com/vercel/turbo/pull/4881
2023-05-10 11:07:40 +02:00
OJ Kwon
71d8064b3d
feat(next-core): relay transform plugin (#48899)
<!-- 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 or adding/fixing 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

### Why?

### How?

Closes NEXT-
Fixes #

-->

#### What
Part 1 for WEB-848. 

This PR implements initial path to enable relay compiler option in
Turbopack. PR is based on approach WEB-955, that passing custom plugin
transform itself instead of trying to pass down configuration into
turbopack. In result, this PR requires counterpart turbopack PR at
https://github.com/vercel/turbo/pull/4721.

PR also refactors next-shared's transform bit, as we have grown number
of custom transforms.

Unfortunately there are some runtime errors with this transforms, so it
is not possible to use relay actually yet. WEB-956 tracks this.
(https://github.com/swc-project/plugins/pull/179)

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-05-09 11:09:34 -07:00
Tobias Koppers
e96fce41c4
render app pages with original url (#49198)
### What?

Use pre-rewrite URL for rendering

### Why?

Rendering app pages needs the original user facing URL.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4818 <!-- Tobias Koppers - pass
original url with content source data -->
* https://github.com/vercel/turbo/pull/4817 <!-- Tobias Koppers - avoid
errors in computing issue details -->
2023-05-04 15:46:36 +02:00
Tobias Koppers
d908bd89bf
update turbopack (#49196)
* https://github.com/vercel/turbo/pull/4815 <!-- Tobias Koppers - fix
CSS HMR -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 14:24:36 +02:00
Alex Kirszenberg
7092266076
Add support for app global and segment 404 pages (#49085)
See https://github.com/vercel/turbo/pull/4776

This adds support for:

* Default and custom global app 404 pages (`app/not-found`).
* Segment-level 404 pages (`app/segment/not-found`).

This also updates Turbopack:

* https://github.com/vercel/turbo/pull/4787 <!-- Tobias Koppers -
Bugfixes for free var and binding replacement -->
* https://github.com/vercel/turbo/pull/4789 <!-- Alex Kirszenberg -
Print a warning when importing Sass files -->
* https://github.com/vercel/turbo/pull/4776 <!-- Alex Kirszenberg -
Leave pathname formatting up to the caller -->
* https://github.com/vercel/turbo/pull/4790 <!-- Tobias Koppers - remove
inital compilation message by default -->

## TODO:

- [ ] ~~The dev overlay shows up when `notFound()` is called, it should
be hidden~~ (moved to WEB-980)
- [ ] ~~Navigating to the global 404 page doesn't work~~ (this is a bug
in Next.js, see NEXT-963)
- [x] Tests.

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-03 18:10:17 +00:00
Tobias Koppers
194da0b3e3
add test case for non-enumerable exports (#49106)
### What?

test case for https://github.com/vercel/turbo/pull/4783
2023-05-03 04:23:41 +00:00
Tobias Koppers
fe38369618
add test cases for error handling (#49093)
### What?

test cases for https://github.com/vercel/turbo/pull/4779
2023-05-02 22:09:55 +02:00
Tobias Koppers
90153ffd8d
update turbopack (#49071)
* https://github.com/vercel/turbo/pull/4691 
* https://github.com/vercel/turbo/pull/4765 
* https://github.com/vercel/turbo/pull/4772
2023-05-02 08:19:30 +00:00
Tobias Koppers
dbccc794e3
fix GlobalError interop and add test case (#49033)
### What?

fixes handling of GlobalError interop
adds a test case for client component bug

### Why?

app dir client component interop is broken

### Turbopack changes

* https://github.com/vercel/turbo/pull/4597 <!-- Tobias Koppers - add
rspack to our benchmark suite -->
* https://github.com/vercel/turbo/pull/4761 <!-- Tobias Koppers - Do not
use interop logic on proxy modules -->
2023-05-01 14:51:37 +02:00
Alex Kirszenberg
3362851b92
More fluent GraphTraversal API (#49028)
See https://github.com/vercel/turbo/pull/4598

### Turbopack changes

* https://github.com/vercel/turbo/pull/4754 <!-- Justin Ridgewell -
Match TS's extends resolution algorithm -->
* https://github.com/vercel/turbo/pull/4598 <!-- Alex Kirszenberg - More
fluent GraphTraversal API -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-01 14:08:25 +02:00
Donny/강동윤
7e0a6f83f6
chore: Update swc_core to v0.75.41 (#48982)
### What?

Update swc_core and `@swc/core`.

### Why?

https://github.com/vercel/turbo/issues/4747 seems like a critical issue.

### How?

 - Fix WEB-969

### Turbopack changes

* https://github.com/vercel/turbo/pull/4688 <!-- OJ Kwon - ci(workflow):
add appdir underscore test to subset -->
* https://github.com/vercel/turbo/pull/4751 <!-- Justin Ridgewell -
Cleanup "started server on" message -->
* https://github.com/vercel/turbo/pull/4756 <!-- Donny/강동윤 - chore:
Update `swc_core` to `v0.75.41` -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-01 13:15:24 +02:00
Alex Kirszenberg
7b348fa0f2
Use ProxiedAsset instead of css_chunk_root_path to expose RSC CSS chunks (#48946)
See https://github.com/vercel/turbo/pull/4740

This enables RSC CSS HMR. The `css_chunk_root_path` way somehow broke
the propagation of invalidation for CSS chunks.

This also updates Turbopack with the following changes:

* https://github.com/vercel/turbo/pull/4738 <!-- Tobias Koppers -
improve commonjs esm interop and node ESM -->
* https://github.com/vercel/turbo/pull/4740 <!-- Alex Kirszenberg -
Replace css_chunk_root_path with ProxiedAsset -->
* https://github.com/vercel/turbo/pull/4741 <!-- Tobias Koppers - add
svg size extraction -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-04-28 20:37:34 +02:00
Justin Ridgewell
a2a3f5e378
turbopack: parse and propagate output: 'export' (#48046)
Depends on https://github.com/vercel/turbo/pull/4491

This adds support for the new `output: 'export'` configuration, and
propagates the value through to our Node.js rendering code to render.
Unfortunately, we don't support page-level configs at the moment, so we
can't set a `export const config = { dynamic: 'force-dynamic' }` and
test that the export value is being received (I've manually verified it,
though).

Fixes WEB-842
2023-04-28 06:36:32 +00:00
Alex Kirszenberg
3ed412a308
Selectively load runtime CSS modules to avoid rule duplication (#48866)
See https://github.com/vercel/turbo/pull/4695

### Turbopack changes

* https://github.com/vercel/turbo/pull/4683 <!-- Alex Kirszenberg -
Update benchmark data -->
* https://github.com/vercel/turbo/pull/4695 <!-- Alex Kirszenberg -
Selectively load runtime CSS modules to avoid rule duplication -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-27 13:47:36 +02:00
Tobias Koppers
219d1d49c7
update turbopack (#48893)
### What?

* https://github.com/vercel/turbo/pull/4700 <!-- Tobias Koppers - update
deps -->
* https://github.com/vercel/turbo/pull/4706 <!-- Tobias Koppers - make
library code less verbose in stack traces -->
* https://github.com/vercel/turbo/pull/4705 <!-- Tobias Koppers -
improve error handling in update stream -->
* https://github.com/vercel/turbo/pull/4667 <!-- Caleb Webber - remove
box_syntax -->
* https://github.com/vercel/turbo/pull/4714 <!-- Tobias Koppers - chunk
hash need to include availability root -->
* https://github.com/vercel/turbo/pull/4709 <!-- Alex Kirszenberg -
Allow the dev server socket to be reused immediately -->
* https://github.com/vercel/turbo/pull/4716 <!-- Tobias Koppers - errors
lead to consistent exit code in issue detail -->
2023-04-27 00:46:04 +02:00
OJ Kwon
f3d5c2fe9e
refactor(next-swc): turbopack_ecmascript_plugins (#48671)
<!-- 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 or adding/fixing 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


### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

This PR is necessary changes to apply
https://github.com/vercel/turbo/pull/4662. Need turbopack bump to make
CI pass.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-26 15:55:53 +02:00
Tobias Koppers
5a46b01ab9
update turbopack (#48846)
* https://github.com/vercel/turbo/pull/4692 
* https://github.com/vercel/turbo/pull/4595 
* https://github.com/vercel/turbo/pull/4690 
* https://github.com/vercel/turbo/pull/4663
2023-04-26 06:55:37 +00:00
Alex Kirszenberg
7fdcb172f9
Lazy DevHtmlAsset chunk generation (#48768)
This fixes a perf regression introduced in the chunking refactor, where
we would be eagerly generating all assets from the web entry and
fallback sources.

See https://github.com/vercel/turbo/pull/4679

This also brings the following updates from vercel/turbo:

* https://github.com/vercel/turbo/pull/4669 <!-- Tobias Koppers - make
the invalidation reason easier to read -->
* https://github.com/vercel/turbo/pull/4670 <!-- Tobias Koppers -
dev-server content might change any time, we can't cache them -->
* https://github.com/vercel/turbo/pull/4653 <!-- OJ Kwon -
fix(ecmascript): displayname for styled_components -->
* https://github.com/vercel/turbo/pull/4679 <!-- Alex Kirszenberg - Lazy
DevHtmlAsset chunk generation --> (this change)
2023-04-24 12:11:24 +02:00
Tobias Koppers
ec385decd3
replace defined values and add __NEXT_HAS_REWRITES define (#48628)
### What?

This fixes a problem when the router fails to load the correct JS file
from the page_loader and opts out to full refresh

### Why?

The router behaves incorrect when `__NEXT_HAS_REWRITES` is missing in
turbopack

### How?

see also https://github.com/vercel/turbo/pull/4652

### Turbopack changes

* https://github.com/vercel/turbo/pull/4650 <!-- Tobias Koppers - reduce
size of TypeType from 32bytes to 16bytes -->
* https://github.com/vercel/turbo/pull/4648 <!-- Tobias Koppers - handle
chunk register in the sync runtime.none correctly -->
* https://github.com/vercel/turbo/pull/4609 <!-- OJ Kwon -
fix(ecmascript): eval assignop to the ident -->
* https://github.com/vercel/turbo/pull/4652 <!-- Tobias Koppers - allow
to pass constant values to free var references -->
* https://github.com/vercel/turbo/pull/4649 <!-- Tobias Koppers - Image
processing improvements -->
2023-04-20 20:02:39 +02:00
Tobias Koppers
189e6a3687
use structured images with metainfo (blur placeholder) (#48531)
### What?

add support for blur placeholder generation to turbopack

add `StructuredImageModuleType` which is used with `ModuleType::Custom`
to allow importing an image as `{ url, width, height, blurDataURL,
blurWidth, blurHeight }`

in contrast to next.js with webpack this will also generate blur
placeholder in development instead of using a _next/image reference.
This should lead to more production-like experience (at the cost of a
little bit of compilation time).

turbo PR: https://github.com/vercel/turbo/pull/4621

### Why?

Turbopack was crashing on `placeholder="blur"` before.

fixes WEB-534

### Turbopack changes

* https://github.com/vercel/turbo/pull/4521 <!-- OJ Kwon -
feat(contextcondition): support InPath contextcondition -->
* https://github.com/vercel/turbo/pull/4601 <!-- Alex Kirszenberg -
Chunking Context Refactor pt. 3: Address PR comments from pt. 2 -->
* https://github.com/vercel/turbo/pull/4623 <!-- Tobias Koppers -
exclude turborepo from turbopack bench tests -->
* https://github.com/vercel/turbo/pull/4399 <!-- Leah - support
require.context -->
* https://github.com/vercel/turbo/pull/4610 <!-- OJ Kwon - test(subset):
add mdx test into subset -->
* https://github.com/vercel/turbo/pull/4624 <!-- Tobias Koppers - run
benchmarks on windows and macOS too -->
* https://github.com/vercel/turbo/pull/4620 <!-- Alex Kirszenberg - Make
ContainmentTree fully generic -->
* https://github.com/vercel/turbo/pull/4600 <!-- Tobias Koppers - add
getChunkPath method -->
* https://github.com/vercel/turbo/pull/4621 <!-- Tobias Koppers - add
turbopack-image -->
* https://github.com/vercel/turbo/pull/4639 <!-- Tobias Koppers -
restrict snapshot path for windows path length limit -->
* https://github.com/vercel/turbo/pull/4641 <!-- Tobias Koppers - put
webp behind a feature flag -->
2023-04-20 02:18:59 +02:00
OJ Kwon
9f5463dc9a
build(cargo): move workspaces manifest to top level (#48198)
<!-- 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 or adding/fixing 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


### How?

Closes NEXT-
Fixes #

-->

### What?
This PR changes to the `root` of the cargo workspace to the root of repo
itself, allows next-swc and other rust codebase can use repo root as
workspace root.

### Why?
Currently cargo manifest for the next-swc is not placed under the root
of the repo, which makes invocation to the tool requires to change cwd /
or set cwd. Similarly needs to open editor to the root of the cargo
manifest separately to able to utilize language server kicks in. Moving
manifest to the root consolidates those, so can invoke either cli / or
editor to the same root of the repo.
2023-04-19 18:38:36 +02:00
Renamed from packages/next-swc/Cargo.toml (Browse further)