Commit graph

18767 commits

Author SHA1 Message Date
vercel-release-bot
f51ee191da v14.0.5-canary.10 2023-12-13 18:08:37 +00:00
Dima Voytenko
96cc789f7d
transpilePackages should override default settings for external packages (#59385)
See related https://github.com/vercel/next.js/issues/51969. It should no
longer apply.
2023-12-13 19:04:57 +01:00
Andrew Clark
c964e9a481
Make CacheNodeSeedData match FlightRouterState more closely (#59590)
When PPR is enabled, the CacheNodeSeedData and FlightRouterState
contained in an RSC payload (whether it's static or dynamic) should
always have the same tree structure.

The only reason the two trees would ever be different is if the server
partially renders with `loading.tsx`, but that behavior doesn't exist
when PPR is enabled. (In that case, the CacheNodeSeedData would describe
only a subset of FlightRouterState.)

The behavior is already correct but to make the types a bit closer, this
changes the `parallelRoutes` slot of CacheNodeSeedData to be
non-nullable; if there are no children, it should be an empty object.

It's not semantically important, I'm only changing it to make the types
more consistent, since we typically traverse both trees in parallel.

Eventually we will probably merge these into a single transport type.

Closes NEXT-1868
2023-12-13 12:59:21 -05:00
Andrew Clark
79e82d42c6
Fix another magic segment string constant (#59591)
Follow-up to #59552, I think this one was missed because it landed
around the same time as #59538.

Closes NEXT-1869
2023-12-13 17:36:19 +00:00
Leah
e9ac616414
chore: update Turbopack (#59589)
### Changes

* https://github.com/vercel/turbo/pull/6777 <!-- Leah -
fix(turbopack-ecmascript-runtime): handle non encoded CSS paths -->
* https://github.com/vercel/turbo/pull/6785 <!-- Tim Neutkens - Ensure
turbopack-trace-server doesn't send message in a loop -->



Closes PACK-2147
2023-12-13 18:25:37 +01:00
Delba de Oliveira
7234502406
Docs: Add missing closing tag (#59581) 2023-12-13 07:10:14 -08:00
Zack Tanner
855139b239
cleanup magic segment strings (#59552)
This uses the existing PAGE_SEGMENT constant in places where we had
`__PAGE__` and introduces a similar constant for `__DEFAULT__`.
<!-- 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-1860
2023-12-13 07:03:40 -08:00
Delba de Oliveira
f518fd81b3
Docs: Fix formatting in testing docs and update examples dependencies (#59572)
Follow-up from: https://github.com/vercel/next.js/pull/59268
2023-12-13 07:02:53 -08:00
Andrew Clark
9dfeced234
Fork navigateReducer into PPR and non-PPR versions (#59538)
The PPR implementation of navigateReducer is expected to diverge
significantly from the existing, non-PPR implementation. So this forks
them into two separate functions. This will be easier to maintain than
two different implementations inside the same function, especially
considering we don't expect any more changes to the non-PPR
implementation.

This also reduces the chances we'll introduce an accidental regression
into the non-PPR version, which is the stable one that all users (except
for the ones dogfooding PPR) are currently using.

For now, the two implementations are identical. I'll start making
changes in subsequent PRs.

Only one implementation will be included in the final build; the other
one will be dead code eliminated because the feature check is statically
inlined at build time:

```js
export const navigateReducer = process.env.__NEXT_PPR
  ? navigateReducer_PPR
  : navigateReducer_noPPR
```

Closes NEXT-1856
2023-12-13 10:02:27 -05:00
Tim Neutkens
55645ffc8a
Fix closing tags for jest docs (#59579) 2023-12-13 15:51:17 +01:00
Jiachi Liu
f1143bc4f4
docs: fix bad closed tag (#59575)
Found this from build error trace while testing the change in #59569 

```
docs/02-app/01-building-your-application/08-testing/02-jest.mdx": UnexpectedMDXError: Error: Build failed with 1 error:
--
  _mdx_bundler_entry_point-776983b1-6900-47c0-98cc-0c35882e9532.mdx:297:0: ERROR: [plugin: @mdx-js/esbuild] Unexpected closing tag `</PageOnly>`, expected corresponding closing tag for `<PagesOnly>
```



Closes NEXT-1863
2023-12-13 15:30:24 +01:00
Jiachi Liu
60e84073b8
Fix test/tsconfig.json alias for internal test utils (#59570)
Inside `test/` folder we should use different path for alias paths
Follow up #59550
2023-12-13 13:57:23 +00:00
Jiachi Liu
5f7fd46906
Enable build worker by default (#59405) 2023-12-13 13:36:56 +00:00
Jiachi Liu
61a7db63b0
types: cover the tests with root tsconfig.json (#59550) 2023-12-13 11:55:02 +01:00
Jiachi Liu
572a6bce35
Should not show no index for client rendering bailout (#59531) 2023-12-13 11:03:11 +01:00
Delba de Oliveira
0ddc7e8fad
Docs: Add App Router Testing Guides and update /examples (#59268)
This PR updates the testing guides to use App Router and TypeScript,
also updates `/examples` to show `app` and `pages` examples.

## Overview

- [x] Create a new "Testing" section that is shared between `app` and
`pages`.
- [x] Explain the differences between E2E, unit testing, component
testing, etc.
- [x] Recommend E2E for `async` components as currently none of the
tools support it.
- [x] Update setup guides for **Cypress**, **Playwright**, and **Jest**
with latest config options, and examples for `app` and `pages`.
- [x] Add new guide for **Vitest**
- [x] Clean up `/examples`: use TS, show `app` and `pages` examples,
match docs config

## Cypress

- [x] E2E Tests
- [x] Component Testing
  - [x] Client Components
  - [x] Server Components
  - [ ] `async` components

**Blockers:** 
- TS: `Option 'bundler' can only be used when 'module' is set to
'es2015' or later`. In **tsconfig.json** compilerOptions, Next.js uses
"moduleResolution": "bundler", changing it to "node" fixes the issue but
it can have repercussions.
  - https://github.com/cypress-io/cypress/issues/27731 
- Version 14 is currently not supported for component testing
  - https://github.com/cypress-io/cypress/issues/28185

## Playwright

- [x] E2E Tests

## Jest

- [x] Unit Testing
   - [x] Client Components
   - [x] Server Components
- [ ] `async` components:
https://github.com/testing-library/react-testing-library/issues/1209
   - [x]  'server-only': https://github.com/vercel/next.js/pull/54891
- [x] Snapshot Testing

**Blockers:**
- TS: https://github.com/testing-library/jest-dom/issues/546
- None of the solutions in the issue work with Next.js v14.0.4 and TS v5

## Vitest 

- [x] Unit Testing
  - [x] Client Components
  - [x] Server Components
  - [ ] `async` components
  - [x] 'server-only'
 - [x] Update vitest example
- [x] Handles CSS, and CSS modules imports
- [x] Handles next/image

## Other

- https://github.com/vercel/next.js/issues/47448
- https://github.com/vercel/next.js/issues/47299
2023-12-12 22:30:23 -06:00
vercel-release-bot
32759b48b7 v14.0.5-canary.9 2023-12-13 00:24:16 +00:00
Rahul Mishra
9973770b43
chore(create-next-app): bump prompts to v2.4.2 (#59006)
<!-- 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 #

-->
This PR updates `prompts` to `v2.4.2`, it fixes a bug I found and I
haven't seen any reports about it.
## The Bug
[Screencast from 2023-11-28
17-58-41.webm](https://github.com/vercel/next.js/assets/130567419/cf17f0d8-39f3-4ced-80ca-9fb5962587d8)

There was a bug in `prompts` where it didn't handle <kbd>Home</kbd> and
<kbd>End</kbd> button correctly. It has been fixed in later version. I
have updated `prompts` along with `@types/prompts` to latest available
version which is `v2.4.2`.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-12-12 16:16:13 -08:00
JJ Kasper
95fe24f61d
Fix force-static and fetch no-store cases (#59549)
This ensures that `export const dynamic = 'force-static'` is properly
honored when a page contains fetches with `cache: 'no-store'`, `cache:
'no-cache'` or `next: { revalidate: 0 }`.

Closes NEXT-1858
2023-12-12 16:08:03 -08:00
vercel-release-bot
e9757175bc v14.0.5-canary.8 2023-12-12 23:22:00 +00:00
OJ Kwon
61889f8969
fix(playwright): teardown when global quit force terminates browser (#59548) 2023-12-12 15:18:47 -08:00
Wyatt Johnson
ed12b552de
Page Info Cleanup (#59430)
This updates the some of the logic around updating `PageInfo` entries in
the `pageInfos` map. This is a followup to #59420.

Closes NEXT-1838
2023-12-12 14:37:00 -07:00
Wyatt Johnson
d397b39db1
Update Deployment Testing (#59448)
Previously when running deployment tests, the testing infrastructure
used the Vercel REST API to manage and work with deployments to perform
the actual testing. This now utilizes the Vercel CLI instead (while
maintaining the same beheviour as before) to simplifiy the
implementation.

In cases where testing is performed against a locally configured Vercel
CLI that's already authenticated it will now use those pre-configured
credentials.

Closes NEXT-1841
2023-12-12 14:35:48 -07:00
akawalsky
6fbff29a2e
allow passing wildcard domains in serverActions.allowedDomains (#59428)
Implementation of feature request opened here -
https://github.com/vercel/next.js/discussions/59427

Approach:

~~We are using micromatch in the csrf protection step of actionHandler
to allow for wildcard domains passed in allowedDomains. This is the same
library used for matching domains for remote images.~~

If any of the allowed domains match the origin of the request, we skip
the downstream error thrown for csrf protection.

Edit:

Micromatch is not available in this context as it is only compatible
with Node. This codepath can be run from the edge, so we need to rely on
vanilla js compatible code only.

Instead of falling back to allowing the user to pass in a regex, which
can be somewhat insecure, we opt into continuing to use a wildcard
pattern from a configuration standpoint and instead use a simple
function that matches on wildcards using string comparison and
iteration.

Ideally, Micromatch can be retrofitted to work in non-Node settings and
this piece of code can be replaced in the future, without deprecating or
changing the next.config interface.

---------

Co-authored-by: Josh Story <story@hey.com>
2023-12-12 11:08:36 -08:00
Andrew Clark
5adacb6912
Add CacheNode.prefetchRsc field (#59537)
Adds a new field `prefetchRsc` to CacheNode that will be used by the PPR
implementation. It represents a static version of the segment that can
be showed immediately, and may or may not contain dynamic holes. It's
prefetched before a navigation occurs. During rendering, we will choose
whether to render `rsc` or `prefetchRsc` with `useDeferredValue`.

As with the `rsc` field, a value of `null` means no value was provided.
In this case, the LayoutRouter will go straight to rendering the `rsc`
value; if that one is also missing, it will suspend and trigger a lazy
fetch.

The non-PPR implementation will never set this value.

This PR adds the field to the CacheNode type but doesn't implement any
of the behavior yet. Mostly this involves updating the router reducer
unit tests.

Closes NEXT-1855
2023-12-12 13:28:05 -05:00
Zack Tanner
b441cff7a9
fix NODE_OPTIONS=inspect (#59530)
Passing `NODE_OPTIONS='--inspect'` was failing because a sub-process was
getting created (`getRegistry()`) which would trigger a "address already
in use" error when the process inherited the same debugger port from the
parent process.

I had to disable this test in
https://github.com/vercel/next.js/pull/59508 because it wasn't passing,
CI was just skipping it. This PR fixes the behavior and re-enables the
test.

Fixes #55862

Closes NEXT-1854
2023-12-12 07:03:13 -08:00
C. T. Lin
eb6aae640f
chore: bump typescript-eslint to 6.14 (#59514) 2023-12-12 11:27:15 +01:00
Andrew Clark
9663d78bf9
Rename CacheNode.subTreeData -> .rsc (#59491)
I want to give this field a name that's bit less generic and
distinguishes it from `lazyData` (because that one has a different type
and is a special case we want to eventually remove).

I'm also about to add an optional `prefetchRsc` field that represents a
prefetched version of the same value. The common suffix is meant to
communicate how they are related.

Doing this rename in its own PR because it's a pure find-and-replace,
whereas the later steps are not.

Closes NEXT-1846
2023-12-11 21:41:03 -05:00
OJ Kwon
2dbd4e7529
test(fixture): try to include sources in the snapshot (#59499) 2023-12-11 18:10:34 -08:00
John Pham
d96a7e56a6
Add text-wrap: balance to CNA template for card descriptions (#59384)
### What?
This prevents the descriptions from having orphans at different viewport
widths.

### Why?

| Default | Pretty | Balance |
|--------|-------| --- |
|
![image](https://github.com/vercel/next.js/assets/16027268/66c8eac4-b995-4c30-9bdc-fd44a4a7fdda)
|
![image](https://github.com/vercel/next.js/assets/16027268/07a2e45a-728b-438f-a4e5-98f7c1c5c33a)
|
![image](https://github.com/vercel/next.js/assets/16027268/153fe94a-2b10-4e39-bb19-b1ca702bcea8)
|
2023-12-11 17:41:01 -08:00
Jiachi Liu
95168bf136
Fix third party typings (#59503) 2023-12-12 01:07:17 +01:00
Zack Tanner
bd5157c78c
fix integration test workflow (#59508)
This was incorrectly setting the upper bound on the `--group` argument
to our test runners (ie, `11/122`), which was causing a lot of tests to
be missed.

Closes NEXT-1851
2023-12-11 15:33:23 -08:00
vercel-release-bot
ba6b8fdee4 v14.0.5-canary.7 2023-12-11 20:43:59 +00:00
JJ Kasper
c7a29bd13e
Fix webpack chunks handling in traces (#59498)
This ensures we don't include all chunks in `nft` traces un-necessarily
as our webpack plugin already tracks which are needed per-entry.

x-ref: [slack
thread](https://vercel.slack.com/archives/C0591D8EN4C/p1702318184832319?thread_ts=1701815919.923639&cid=C0591D8EN4C)

Closes NEXT-1847
2023-12-11 11:35:35 -08:00
OJ Kwon
618c7285a2
ci(test): upload playwright artifacts seperately (#59496)
###

Updating snapshot upload location per suggestion at
https://github.com/vercel/next.js/pull/59469#discussion_r1422943741

Closes PACK-2132

---------

Co-authored-by: Leah <8845940+ForsakenHarmony@users.noreply.github.com>
2023-12-11 19:07:08 +00:00
Wyatt Johnson
7dd7f5131b
Generate Params Cleanup (#59431)
This updates the `collectGenerateParams` method to use a loop rather
than being recursive as well as updating some of the Typescript types.
This is a follow up of #59420.

Closes NEXT-1839
2023-12-11 11:41:46 -07:00
Janicklas Ralph
ce92cea18d
Adding Google analytics to next/third-parties (#58418)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-12-11 18:21:32 +00:00
Andrew Clark
c2ab5f704a
Rename CacheNode.data → .lazyData (#59473)
`CacheNode.data` is used to lazily kick off a request during render, and
represents the result of the entire Flight response. It doesn't
correspond directly to the RSC data of the cache node itself — that's
`subTreeData`. To complicate things further, I'm about to add another
field to CacheNode that represents prefetched RSC data.

To make it a little less confusing, I've renamed the `data` field to
`lazyData`. Still not perfectly clear on first glance, but it's at least
more specific. With PPR, the goal is to remove the lazy data fetching
mechanism in favor of initiating the request immediately upon
navigation. So this field will eventually go away.

In the next PR, I will rename `subTreeData`, too. Perhaps something with
"rsc" in the name so it's less generic than "data".

Closes NEXT-1843
2023-12-11 11:33:12 -05:00
OJ Kwon
25d58d4c5a
test(runner): preserve browser tracing if test fails (#59469) 2023-12-11 08:21:46 -08:00
vercel-release-bot
29e25e0261 v14.0.5-canary.6 2023-12-11 16:19:40 +00:00
Andrew Clark
c370aa9ab9
Remove CacheNode.status field (#59472)
I'm about to make some changes to the CacheNode data structure, and
before I add more complexity, I noticed an opportunity to remove some —
the `status` field isn't logically necessary:

- The `DATA_FETCH` and `LAZY_INITIALIZED` states are already treated as
equivalent; in either case, they will cause the render to suspend during
render, trigger a lazy data fetch (if one hasn't been triggered
already), and then update the router with the result of the response.
- `subTreeData` is null if and only if the node is in the `DATA_FETCH`
or `LAZY_INITIALIZED` states, and it always causes the render to
suspend. So rather than check if the status is one of those, we can
check if `subTreeData` is null.

The most important changes are to CacheNode type in
app-router-context.shared-runtime and the lazy fetching logic in
LayoutRouter. Everything else in the diff is related to deleting the
`status` field wherever a CacheNode is referenced, like in the reducer
unit tests.

Closes NEXT-1842
2023-12-11 10:40:03 -05:00
Lee Robinson
c542a761d2
docs: remove broken link in webpack section (#59487) 2023-12-11 08:59:58 -06:00
vercel-release-bot
e02fe314dc v14.0.5-canary.5 2023-12-09 23:21:27 +00:00
Eric Bidelman
6e6533c97c
Update 10-route-handlers.mdx (#59443)
According to
https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic,
the default for dynamic is "auto".

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

-->
2023-12-09 18:52:37 +00:00
Vercel Release Bot
4a6d3675f2
Update font data (#59426)
This auto-generated PR updates font data with latest available
2023-12-08 17:14:04 -08:00
Andrew Clark
f9b85387fb
loading.tsx should have no effect on partial rendering when PPR is enabled (#59196)
Before PPR, the way instant navigations work in Next.js is we prefetch
everything up to the first route segment that defines a loading.js
boundary. The rest of the tree is defered until the actual navigation.
It does not take into account whether the data is dynamic — even if the
tree is completely static, it will still defer everything inside the
loading boundary.

The approach with PPR is different — we prefetch as deeply as possible,
and only defer when dynamic data is accessed. If so, we only defer the
nearest parent Suspense boundary of the dynamic data access, regardless
of whether the boundary is defined by loading.js or a normal <Suspense>
component in userspace.

This PR removes the partial behavior of loading.js when the PPR flag is
enabled. In effect, loading.js now acts like a regular Suspense boundary
with no additional special behavior.

Note that in practice this usually means we'll end up prefetching more
than we were before PPR, which may or may not be considered a
performance regression by some apps. The plan is to address this before
General Availability of PPR by introducing granular per-segment
fetching, so we can reuse as much of the tree as possible during both
prefetches and dynamic navigations. But during the beta period, we
should be clear about this trade off in our communications.

## Testing strategy

While I was writing a test, I noticed that it's currently pretty
difficult to test all the scenarios that PPR is designed to handle, so I
gave special attention to setting up a testing strategy that I hope will
make this easier going forward. The overall pattern is based on how
we've been testing concurrent rendering features in the React repo for
many years:

- In the e2e test, spin up an HTTP server for responding to requests
sent by the test app. This simulates the data service that would be used
in a real Next.js application, whether it's direct db access, an ORM, or
a higher-level data access layer. The e2e test can observe when
individual requests are received, and control the timing of when the
data is fulfilled, without needing to mock any lower level I/O. (We're
already using a similar pattern to [test fetch
deduping](a3616d33ed/test/e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts (L8-L29)).)
- Each time a request is received, write to an event log. Then assert on
the result of the log at different points throughout the test. This
helps catch subtle mistakes where the order of events is not expected,
or the same event happens more than it should.

(I wrote some test helpers, but to avoid early abstraction, I've
intentionally not moved them into a separate module.)

Closes NEXT-1779
2023-12-08 18:41:01 -05:00
vercel-release-bot
e1a9c5aefb v14.0.5-canary.4 2023-12-08 23:22:08 +00:00
Sebastian Silbermann
79a8d01ae6
Use new JSX transform (#56294)
Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-12-09 00:17:50 +01:00
Zack Tanner
4dd8c0bb04
ci: only run release commit check on canary releases (#59423)
We don't want to perform this check for stable releases since those are
never initiated by the cron task, as otherwise it would fail when going
from canary -> stable as no commits would land in-between.

Closes NEXT-1836
2023-12-08 21:46:26 +00:00
Delba de Oliveira
6d82b0698b
Docs: Polish Server Actions Page 💅🏼 (#59400) 2023-12-08 14:41:16 -06:00