Commit graph

21455 commits

Author SHA1 Message Date
hardfist
4671201414 chore: test on ci 2024-07-24 18:36:14 +08:00
hardfist
d35868b6ef chore: fix type 2024-07-24 17:59:30 +08:00
hardfist
7adad563d1 chore: remove netlify-blog temporarily 2024-07-24 17:35:11 +08:00
hardfist
308ebf1b44 chore: dev working now 2024-07-24 17:29:46 +08:00
hardfist
012e06134b chore: test hmr 2024-07-23 23:40:21 +08:00
hardfist
9aea7338c4 chore: disable fast-refresh 2024-07-23 08:08:01 +08:00
hardfist
494c3e6242 chore: remove unnecesary log 2024-07-22 18:04:09 +08:00
hardfist
b293872610
Netlify blog sample (#6) 2024-07-22 17:58:48 +08:00
hardfist
1cd3e39e10 chore: fix css and hydration 2024-07-22 17:35:02 +08:00
hardfist
3151bb58f2 chore: use css loader 2024-07-22 15:50:29 +08:00
hardfist
783c32024e chore: revert back code 2024-07-21 18:29:06 +08:00
hardfist
03eba8f996 chore: reduce modified code 2024-07-21 18:20:58 +08:00
hardfist
1fa178b627 chore: make next-css work 2024-07-21 18:07:01 +08:00
hardfist
127fccb133 chore: remove log 2024-07-21 17:16:41 +08:00
hardfist
849568cc14 chore: clean some code 2024-07-21 17:14:40 +08:00
hardfist
001664e3bc chore: add basic-export build work 2024-07-21 17:07:05 +08:00
vercel-release-bot
8f5f0ef141 v15.0.0-canary.56 2024-07-05 23:22:48 +00:00
Hendrik Liebau
09f115d187
Configure source map overrides for turbopack (#67497)
Follow-up from #66254 to add debugging support for turbopack.
2024-07-05 18:55:02 +02:00
Delba de Oliveira
7e37892806
Docs: Update unstable_rethrow example (#67494)
re: https://x.com/jamannnnnn/status/1809133455592067373
2024-07-05 08:55:24 -07:00
Jiachi Liu
1268f99e9e
Dedupe double logged server errors (#67464)
### What

Only call error log in SSR renderer, instead of calling it in all RSC
and SSR renderers.

Fixes #67352 
Close NEXT-3579

### Why

The RSC rendered generated result will be rendered by SSR renderer
again, at there we can get the actual error. So when there's a RSC error
happening, only logging once in SSR rendering layer is enough.
2024-07-05 16:22:54 +02:00
Hendrik Liebau
bda92a1be5
Fix VS Code debugging (#66254)
~Due to the entry preloading that was enabled by default in #65289, VS
Code is no longer able to map symbols correctly for production builds.
As a temporary solution, we can disable the preloading when a debugger
is started until a proper fix is found.~

By optionally building the Next.js source code with
`NEXT_SERVER_EVAL_SOURCE_MAPS=1` we can ensure, even with the bundled
next server in the node runtime, that the original names are shown in
the debug "Variables" section.

In addition, the `sourceMapPathOverrides` are improved to cover the
different variations of source mapping URLs. We can now also set
breakpoints in the `example/...` and `test/e2e/...` server components.

~Supersedes #66229~

#### Before

<img width="1276" alt="Screenshot 2024-05-27 at 21 36 52"
src="https://github.com/vercel/next.js/assets/761683/f2840c35-f683-445d-bc95-cac9f719d8e7">

#### After

<img width="1276" alt="Screenshot 2024-05-27 at 21 38 42"
src="https://github.com/vercel/next.js/assets/761683/c801c123-3163-46c3-b442-5b72c0a5d51d">
2024-07-05 16:04:35 +02:00
Hendrik Liebau
a1098cec4d
Remove obsolete isNodeDebugging option from next server (#67492)
Now that `isNodeDebugging` is not needed anymore in #66254, we can
re-create #66229.

The last usage of the `isNodeDebugging` option was removed in #55383.
2024-07-05 15:27:53 +02:00
Sung Ye In
0dbe761e52
fix(next): add cross origin in react dom preload (#67423)
Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-05 15:13:00 +02:00
Jiwon Choi
a5ef0d8da5
Upgrade TypeScript to 5.5.3 (#67454) 2024-07-05 21:19:41 +09:00
Sebastian Silbermann
f49506703e
Improve docs for preview builds (#67422)
Builds can now be addressed by PR number.
2024-07-05 13:12:41 +02:00
Hendrik Liebau
199b869d5b
refactor: avoid unnecessary after wrapper (#67463)
I think the wrap function is a leftover from before #66767. We don't
need to return a tuple here, and can just use the `AfterContext`
directly on the call site. This makes its optionality a bit more
obvious, and avoids the noop callback.
2024-07-05 12:56:53 +02:00
Tobias Koppers
3f11815b02
avoid merging global css in a way that leaks into other chunk groups (#67373)
### What?

This disallows merging of global css with styles that appear on other
pages/chunk groups.

### Why?

Before we made the assumption that all CSS is written in a way that it
only affects the elements it should really affect.

In general writing CSS in that way is recommended. In App Router styles
are only added and never removed. This means when a user uses
client-side navigations to navigate the application, styles from all
previous pages are still active on the current page. To avoid visual
artefacts one need to write CSS in a way that it only affects certain
elements. Usually this can be archived by using class names. CSS Modules
even enforce this recommendation.

Assuming that all styles are written this way allows to optimize CSS
loading as request count can be reduced when (small) styles are merged
together.

But turns out that some applications are written differently. They use
global styles that are not scoped to a class name (e. g. to `body`
directly instead) and use them in different sections of the application.
They are structured in a way that doesn't allow client-side navigations
between these sections. This should be valid too, which makes our
assumption not always holding true.

This PR changes the algorithm so we only make that assumption for CSS
Modules, but not for global CSS. While this affects the ability to
optimize, applications usually do not use too much global CSS files, so
that can be accepted.

fixes #64773
2024-07-05 03:33:02 -07:00
Vercel Release Bot
609277b271
Update font data (#67472)
This auto-generated PR updates font data with latest available
2024-07-05 09:22:24 +00:00
Sebastian Silbermann
5bdffad843
Bump minimum Node.js version to 18.18 (up from 18.17) (#67274) 2024-07-05 09:21:57 +00:00
vercel-release-bot
83a085acc7 v15.0.0-canary.55 2024-07-04 23:23:21 +00:00
Steven
28fc89448f
fix(next/image): handle invalid url (#67465) 2024-07-04 21:55:32 +02:00
Julian
38b3423160
Fix Dead Links in @neshca/cache-handler-redis example README.md (#67415)
<!-- 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?
Updating links to the @neshca/cache-handler documentation that are dead.
### Why?
To improve developer experience (DX) by ensuring README.md links are
functional.
### How?
Edit the Markdown links in the README.md file of the example to point to
the correct URLs.


-->
Hello,

This PR updates dead links in the @neshca/cache-handler-redis example's
README.md to ensure they point to the correct URLs.

Thank you for your review!

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-04 15:35:15 +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
Ivan Torres
f0abeb8e42
[docs] Update options in create-next-app (#67455)
Documentation update, according to the last update of the `commander`
library. #66771

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-04 12:41:44 +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
Manu López
49f9c46fb1
Fix typo in MDX documentation (#67432)
I was reading the documentation related to MDX and noticed a typo in
some articles, so I fixed them.

Although I read the [Contribution
Guidelines](https://github.com/vercel/next.js/blob/canary/contributing.md)
this is my first contribution so feel free to comment if I can do
better.

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-04 10:50:26 +00:00
Teddi_r
4bf3bb9dcd
docs: fix typo } (#67441)
### What?
Fix a typo in docs.

### Why?
The `cloudfrontLoader` function is missing a closing curly brace `}`.

### How?
Add a closing curly brace `}` at the end of the `cloudfrontLoader`
function.

<!-- 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 #

-->

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-04 09:49:58 +00:00
Jiwon Choi
ce9670ff2e
Upgrade TypeScript to v5.5.2 (#67113) 2024-07-04 10:03:46 +02:00
vercel-release-bot
5c92390337 v15.0.0-canary.54 2024-07-03 23:23:51 +00:00
Zack Tanner
1337c7a3e5
fix dynamic param extraction for interception routes (#67400)
### What
When using `generateStaticParams` with interception routes, the
interception would never occur, and instead an MPA navigation would take
place to the targeted link.

### Why
For interception rewrites, we use a `__NEXT_EMPTY_PARAM__` marker (in
place of the actual param slot, eg `:locale`) for any params that are
discovered prior to the interception marker. This is because during
route resolution, the `params` for the interception route might not
contain the same `params` for the page that triggered the interception.
The dynamic params are then extracted from `FlightRouterState` at render
time. However, when `generateStaticParams` is present, the
`FlightRouterState` header is stripped from the request, so it isn't
able to extract the dynamic params and so the router thinks the new tree
is a new root layout, hence the MPA navigation.

### How
This removes the `__NEXT_EMPTY_PARAM__` hack and several spots where we
were forcing interception routes to be dynamic as a workaround to the
above bug. Now when resolving the route, if the request was to an
interception route, we extract the dynamic params from the request
before constructing the final rewritten URL. This will ensure that the
params from the "current" route are available in addition to the params
from the interception route without needing to defer until render.

Fixes #65192
Fixes #52880
2024-07-03 11:21:07 -07:00
Alan Daniel
13e501fc23
[create-next-app]: add font antialiasing to templates (#67425)
This PR adds font antialiasing to all the next.js templates (with css or
tw).

### Before

![Screenshot 2024-07-03 at 10 27
02](https://github.com/vercel/next.js/assets/45767683/65778211-23bd-4d20-b1d1-a2f443f73d4d)

### After 

![Screenshot 2024-07-03 at 10 26
38](https://github.com/vercel/next.js/assets/45767683/922188fd-4406-4d08-9b73-74c699d51913)

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-03 17:36:13 +00:00
Sebastian Silbermann
978af08cc4
Automatically trigger sync with Front on release (#66453) 2024-07-03 19:09:51 +02:00
vercel-release-bot
b2625477c0 v15.0.0-canary.53 2024-07-03 05:25:20 +00:00
Benjamin Woodruff
d19862ad0f
[chore] Update turbopack to turbopack-240703.1 (#67406)
Tobias Koppers - fix typo (vercel/turbo#8619)
Benjamin Woodruff - Store aggregate read/execute count statistics
(vercel/turbo#8286)
Tobias Koppers - box InProgress task state (vercel/turbo#8644)
Tobias Koppers - Task Edges Set/List (vercel/turbo#8624)
Benjamin Woodruff - Memory: Use `triomphe::Arc` for `SharedReference`
(vercel/turbo#8622)
Will Binns-Smith - chore: release npm packages (vercel/turbo#8614)
Will Binns-Smith - devlow-bench: add git branch and sha to datapoints
(vercel/turbo#8602)

---

Fixes a `triomphe` package version conflict between turbopack and swc by
bumping it from 0.1.11 to 0.1.13.
2024-07-02 21:45:54 -07:00
Donny/강동윤
82639520d3
feat: Pass module: "unknown" to SWC minfiier (#66817)
### What?

Pass `module: "unknown"` to the minifier.

### Why?

It can minify both a module and a script. `module: "unknown"` lets the
parser to detect the type of the program.

The problematic library is `react-pdf` and next.js currently errors with

```
Failed to compile.

static/media/pdf.worker.1f09ce21.mjs from Terser
  x 'import', and 'export' cannot be used outside of module code
       ,-[56104:1]
 56104 | const pdfjsBuild = "0cec64437";
 56105 | 
 56106 | var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
 56107 | export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
       : ^^^^^^
 56108 | 
 56109 | //# sourceMappingURL=pdf.worker.mjs.map
       `----

Caused by:
    0: failed to parse input file
    1: Syntax Error
Error: 
  x 'import', and 'export' cannot be used outside of module code
       ,-[56104:1]
```

### How?

Related:
https://github.com/vercel/next.js/discussions/30237#discussioncomment-9735075
2024-07-03 09:57:30 +09:00
Donny/강동윤
e7a06bedae
Update @swc/core npm package to v1.6.6 (#67379)
### What?

Update `@swc/core` to the latest.

### Why?

To keep in sync.
2024-07-03 09:54:28 +09:00
vercel-release-bot
747a60c311 v15.0.0-canary.52 2024-07-02 23:22:46 +00:00
Neila
669712cbf9
docs: fix typo eanble (#67369)
### What?
Fix a typo in docs.

### Why?
The word *enable* was mistakenly written as *eanble*.

### How?

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-02 15:30:53 +00:00
Sebastian Silbermann
f1488d5d68
Persist package tarballs as GitHub Actions artifacts (#66445) 2024-07-02 15:18:45 +00:00
hrmny
a22858d6e7
test: add test for parallel routes hmr (#67392)
### What?

A test for #67222
2024-07-02 15:07:16 +00:00