Commit graph

103 commits

Author SHA1 Message Date
JJ Kasper
e3fb62b6bf
Add invariant with debug information when failing to load static file (#38075) 2022-06-27 14:15:09 -05:00
Jiachi Liu
a5f8382ee3
Rename page runtime edge to experimental-edge (#38041)
* Rename page runtime edge to experimental-edge

* fix ut

* fix lint

* PageRuntime -> ServerRuntime

* rename constant
2022-06-26 20:02:24 -05:00
Steven
71e25d4f54
Fix npm publish to include future folder (#37999)
* Fix npm publish to include `future` folder

* Fix webpack config and add a test

* lint-fix

* Change static import to url string

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-06-24 18:30:30 -05:00
JJ Kasper
9cac00dbfb
Update flakey prefetch test (#37997) 2022-06-24 15:27:51 -05:00
JJ Kasper
20d6792542
Move outputStandalone config (#37994) 2022-06-24 14:58:35 -05:00
JJ Kasper
edd798e526
Fix hard navigation guard on popstate and handle fetching fresh data (#37970)
* Fix hard navigation guard on popstate and handle fetching fresh data

* undo link changes and handle middleware cases

* update tests
2022-06-24 10:50:41 -05:00
JJ Kasper
7c484a80a6
Ensure cache-control is correct when returning redirect (#37958) 2022-06-23 13:23:30 -05:00
JJ Kasper
89bc9c66ea
Ensure resolvedUrl is correct with fallback rewrites (#37932)
* Ensure resolvedUrl is correct with fallback rewrites

* fix-lint

* normalize slash
2022-06-22 17:02:46 -05:00
JJ Kasper
c4dc081e70
Fix styled-jsx types when package is not hoisted (#37902)
This ensures we expose the `styled-jsx` types correctly even when the package is not hoisted from next's `node_modules` e.g. when using `pnpm`. We had an existing test that covered this although it installed `styled-jsx` at the top-level as a workaround so the test has been updated to remove this workaround. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/pull/37828#discussion_r901164193
2022-06-22 12:09:22 +00:00
Gal Schlezinger
e05c31df17
Throw an error when target: 'serverless' is used with Middleware (#37819)
Serverless target is deprecated, so we don't support it in Middleware as it's a new feature,
but we need to have a good error message for that. This commit solves that.

## Related

* Fixes #37433



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-06-19 13:17:18 +00:00
Balázs Orbán
b8e533b589
chore: use pnpm install in tests (#37712)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-06-16 18:08:07 +00:00
Seiya Nuta
0bf9233e14
[middleware] Warn dynamic WASM compilation (#37681)
In Middlewares, dynamic code execution is not allowed. Currently, we warn if eval / new Function are invoked in dev but don't warn another dynamic code execution in WebAssembly.

This PR adds warnings for `WebAssembly.compile` and `WebAssembly.instantiate` with a buffer parameter (note that `WebAssembly.instantiate` with a **module** parameter is legit) invocations. Note that other methods that compile WASM dynamically such as `WebAssembly.compileStreaming` are not exposed to users so we don't need to cover them.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-06-16 14:59:30 +00:00
JJ Kasper
668466bc07
Fix rewrite/dynamic interpolation E2E cases (#37669) 2022-06-13 15:46:19 -05:00
JJ Kasper
6f698405dd
Update matched path params priority (#37646)
This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. 

x-ref: https://github.com/vercel/next.js/pull/37574

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-06-13 13:34:08 +00:00
Damien Simonin Feugas
ae44779bcb
chore: narrows regexp to enable middleware source maps (#37582)
* chore: narrows regexp to enable middleware source maps

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-06-10 20:22:03 -05:00
JJ Kasper
934e5a4835
Update usage of example.com -> example.vercel.sh (#37630)
* Update usage of example.com -> example.vercel.sh

* another one

* another flakey test
2022-06-10 18:19:37 -05:00
JJ Kasper
607ff2b322
Update to process redirects/rewrites for _next/data with middleware (#37574)
* Update to process redirects/rewrites for _next/data

* correct matched-path resolving with middleware

* Add next-data header

* migrate middleware tests

* lint-fix

* update error case

* update test case

* Handle additional resolving cases and add more tests

* update test from merge

* fix test

* rm .only

* apply changes from review

* ensure _next/data resolving does not apply without middleware
2022-06-10 12:35:12 -05:00
Jiachi Liu
0bfdf0e0d1
Fix react root env missing in NextServer (#37562)
* Fix react root env missing in NextServer

* switch to useId instead of using process.env var

* add production test

* extend timeout

* fix test

* fix lint

* use version to detect if enable react root
2022-06-09 15:43:38 +02:00
JJ Kasper
142bceb694
Ensure ENOENT error is not ignored when loading pages (#37486)
* Ensure ENOENT error is not ignored when loading pages

* Add a separate PageNotFoundError

* update tests
2022-06-06 14:35:26 -04:00
Kiko Beats
129052dc98
Edge Functions: deprecate access to request.page (#37349)
It uses `URLSearchParams` to have the same behavior.

closes https://github.com/vercel/next.js/issues/34521
2022-06-01 20:06:37 +00:00
JJ Kasper
28dfb1f5f1
Ensure type check/link worker does not retry (#37324) 2022-05-31 11:30:38 -05:00
7iomka
7b91a1c156
Update of @babel/core (#37145)
Update of @babel/core to fix Type-only import specifiers issue


Fixes [#37016](https://github.com/vercel/next.js/issues/37016)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-31 01:00:12 +00:00
Kiko Beats
fafbea8b74
Use Edge Runtime for running Edge Functions locally (#37024)
This PR introduces [Edge Runtime](https://edge-runtime.vercel.app/) for emulating [Edge Functions](https://vercel.com/features/edge-functions) locally.

Every time you run a [middleware](https://nextjs.org/docs/advanced-features/middleware) locally via `next dev`, an isolated edge runtime context will be created.

These contexts have the same constraints as production servers, plus they don't pollute the global scope; Instead, all the code run in a vm on top of a Node.js process.

Additionally, `@edge-runtime/jest-environment` has been added to make easier testing Edge Functions in a programmatic way.

It dropped the following polyfills from Next.js codebase, since they are now part of Edge Runtime:

- abort-controller
- formdata
- uuid
- web-crypto
- web-streams

Co-authored-by: Gal Schlezinger <2054772+Schniz@users.noreply.github.com>
2022-05-30 12:01:36 +00:00
JJ Kasper
923fdcd2c5
Update to not trigger revalidation during prefetch (#37201)
Continuation of https://github.com/vercel/next.js/pull/34498 this updates to send a `purpose: prefetch` header (related [w3c discussion](https://github.com/w3c/resource-hints/issues/74)) when prefetching data routes and then on the server we skip revalidating when this header is set. 

When a client-transition is actually made we send a background HEAD (non-blocking) request to the data route without the `purpose: prefetch` header which signals a revalidation should occur if the data is stale.  

This helps alleviate the number of revalidations occurring currently caused by prefetches as a path can be prefetched but not visited during a session so may not need to be revalidated yet. 

Fixes: https://github.com/vercel/next.js/issues/17758
x-ref: https://github.com/vercel/next.js/discussions/20521
x-ref: [slack thread](https://vercel.slack.com/archives/C031QM96T0A/p1645129445819139?thread_ts=1645124478.067049&cid=C031QM96T0A)
2022-05-29 23:05:23 +00:00
JJ Kasper
f7b81316ae
Update to leverage pnpm for monorepo (#37259)
* Update to leverage pnpm for monorepo

* update compiled

* update stats action

* update ci install step

* update ci

* add test dep

* update invoking scripts

* update caching

* skip cache for now

* update dep

* update packages and fix babel

* update compiled

* update lint

* update test

* update ci

* update pnpm store caching

* update path for windows

* update restore-key config

* update caching

* remove extra build azure stage

* re-add checkout

* update setting pnpm store

* bump

* remove azure caching as pnpm is faster to download

* update contributing

* apply suggestions

* remove install-peers

* prepublish -> prepublishOnly

* prepublish -> prepublishOnly more

* more yarn -> pnpm references

* more yarn -> pnpm references take 2

* use workspace protocol for root package.json

Co-authored-by: Steven <steven@ceriously.com>
2022-05-28 23:35:16 -05:00
José Fernando Höwer Barbosa
01629113bd
Fix Type to solve issue found in #36008 (#36671)
* Fix Type to solve issue found in #36008

It seems the types inside of `DocumentInitialProps` have inconsistencies with the type coming from a fragment 

The issue is documented here https://github.com/vercel/next.js/issues/36008

* Add test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-05-22 23:25:38 -05:00
JJ Kasper
5af2fbb3a7
Update a couple flakey tests (#37071) 2022-05-20 12:44:11 -05:00
Damien Simonin Feugas
bf089562c7
feat(middleware)!: forbids middleware response body (#36835)
_Hello Next.js team! First PR here, I hope I've followed the right practices._

### What's in there?

It has been decided to only support the following uses cases in Next.js' middleware:
- rewrite the URL (`x-middleware-rewrite` response header)
- redirect to another URL (`Location` response header)
- pass on to the next piece in the request pipeline (`x-middleware-next` response header)

1. during development, a warning on console tells developers when they are returning a response (either with `Response` or `NextResponse`).
2. at build time, this warning becomes an error.
3. at run time, returning a response body will trigger a 500 HTTP error with a JSON payload containing the detailed error.

All returned/thrown errors contain a link to the documentation.

This is a breaking feature compared to the _beta_ middleware implementation, and also removes `NextResponse.json()` which makes no sense any more.

### How to try it?
- runtime behavior: `HEADLESS=true yarn jest test/integration/middleware/core`
- build behavior : `yarn jest test/integration/middleware/build-errors`
- development behavior: `HEADLESS=true yarn jest test/development/middleware-warnings`

### Notes to reviewers

The limitation happens in next's web adapter. ~The initial implementation was to check `response.body` existence, but it turns out [`Response.redirect()`](https://github.com/vercel/next.js/blob/canary/packages/next/server/web/spec-compliant/response.ts#L42-L53) may set the response body (https://github.com/vercel/next.js/pull/31886). Hence why the proposed implementation specifically looks at response headers.~
`Response.redirect()` and `NextResponse.redirect()` do not need to include the final location in their body: it is handled by next server https://github.com/vercel/next.js/blob/canary/packages/next/server/next-server.ts#L1142

Because this is a breaking change, I had to adjust several tests cases, previously returning JSON/stream/text bodies. When relevant, these middlewares are returning data using response headers.

About DevEx: relying on AST analysis to detect forbidden use cases is not as good as running the code.
Such cases are easy to detect:
```js
new Response('a text value')
new Response(JSON.stringify({ /* whatever */ })
```
But these are false-positive cases:
```js
function returnNull() { return null }
new Response(returnNull())

function doesNothing() {}
new Response(doesNothing())
```
However, I see no good reasons to let users ship middleware such as the one above, hence why the build will fail, even if _technically speaking_, they are not setting the response body. 



## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-05-19 22:02:20 +00:00
Javi Velasco
f354f46b3f
Deprecate nested Middleware in favor of root middleware (#36772)
This PR deprecates declaring a middleware under `pages` in favour of the project root naming it after `middleware` instead of `_middleware`. This is in the context of having a simpler execution model for middleware and also ships some refactor work. There is a ton of a code to be simplified after this deprecation but I think it is best to do it progressively.

With this PR, when in development, we will **fail** whenever we find a nested middleware but we do **not** include it in the compiler so if the project is using it, it will no longer work. For production we will **fail** too so it will not be possible to build and deploy a deprecated middleware. The error points to a page that should also be reviewed as part of **documentation**.

Aside from the deprecation, this migrates all middleware tests to work with a single middleware. It also splits tests into multiple folders to make them easier to isolate and work with. Finally it ships some small code refactor and simplifications.
2022-05-19 15:46:21 +00:00
Kiko Beats
cc8ab99a92
Edge Cookies: Add .getWithOptions method (#36943)
Hello,

This is an iteration after first work at https://github.com/vercel/next.js/pull/36478.

What that PR missed is a way to just get a cookie value. Well, this PR adds two new things:

`cookies.get` returns the cookie value that could be `string | undefined`:

```js
const response = new NextResponse()
response.cookies.set('foo', 'bar', { path: '/test' })

const value = response.cookies.get('foo')
console.log(value) // => 'bar'
```

Additionally, if you want to know all the cookie details, you can use `cookies.getWithOptions`:

```js
const response = new NextResponse()

response.cookies.set('foo', 'bar', { path: '/test' })
const { value, options } response.cookies.getWithOptions('foo')

console.log(value) // => 'bar'
console.log(options) // => { Path: '/test' }
```
2022-05-19 13:04:58 +00:00
JJ Kasper
f3c31137e1
Fix interopDefault on jest object-proxy (#37002)
This fixes the interop default from https://github.com/vercel/next.js/pull/36877 on the jest `object-proxy` as it currently causes the below error when running tests in our `with-jest` example:

```sh
    TypeError: 'get' on proxy: property '__esModule' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected 'true' but got 'false')
```

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

x-ref: https://github.com/vercel/next.js/pull/36877
2022-05-18 09:41:13 +00:00
Damien Simonin Feugas
4a86a8ffb1
fix(middleware): false positive dynamic code detection at build time (#36955)
## What's in there?

Partially fixes https://github.com/vercel/edge-functions/issues/82
Relates to #36715 

Our webpack plugin for middleware leverages static analysis to detect Dyanamic code evaluation in user `_middleware.js` file (and depedencies). Since edge function runtime do not allow them, the build is aborted.

The use of `Function.bind` is considered invalid, while it is legit. A customer using `@aws-sdk/client-s3` reported it.
This PR fixes it.

Please note that this check is too strict: some dynamic code may be in the bundle (despite treeshaking), but may never be used (because of code branches). Since this point is under discussion, this PR adds tests covering some false positives (`@apollo/react-hook`, `qs` and `has`), but does not change the behavior (consider them as errors).

## Notes to reviewer

I looked for test facilities allowing to download the required 3rd party modules. `createNext()` in production context made my day, but showed two issues:
- `cliOutput` is not cleaned in between tests. While clearance during `stop()` would be annoying, I hope that clearance during `start()` is better.
- if `start()` fails while building, the created instance can never be stopped. This is because we don't clear `childProcess` after `build`. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-05-17 19:35:48 +00:00
Sukka
96034e2d9c
fix(#36651): disable reactRemoveProperties in jest transform (#36922)
## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes #36651.

Always disable `reactRemoveProperties` in `next/jest` transformation.
2022-05-17 11:05:31 +00:00
Steven
d67baa0d1f
Fix return type of middleware req.cookies.get() (#36872)
Follow up to #36478 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-12 21:44:06 +00:00
JJ Kasper
7d52589bd6
Update x-nextjs-cache header in minimal mode (#36791) 2022-05-09 17:08:29 -05:00
Kiko Beats
b78c28f7a0
feat: better cookies API for Edge Functions (#36478)
This PR introduces a more predictable API to manipulate cookies in an Edge Function context.

```js
const response = new NextResponse()

// set a cookie
response.cookies.set('foo, 'bar') // => set-cookie: 'foo=bar; Path=/'`

// set another cookie
response.cookies.set('fooz, 'barz') // => set-cookie: 'foo=bar; Path=/, fooz=barz; Path=/'`

// delete a cookie means mark it as expired
response.cookies.delete('foo') // => set-cookie: 'foo=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT, fooz=barz; Path=/'`

// clear all cookies means mark all of them as expired
response.cookies.clear() // => set-cookie: 'fooz=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT, foo=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT'`
``` 

This new cookies API uses [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) interface, and it's available for `NextRequest` and `NextResponse`.

Additionally, you can pass a specific cookies option as a third argument in `set` method:

```js
response.cookies.set('foo', 'bar', {
  path: '/',
  maxAge: 60 * 60 * 24 * 7,
  httpOnly: true,
  sameSite: 'strict',
  domain: 'example.com'
}
```

**Note**: `maxAge` it's in seconds rather than milliseconds.

Any cookie manipulation will be reflected over the `set-cookie` header, transparently.

closes #31719
2022-05-09 09:50:32 +00:00
JJ Kasper
95fb221e87
Fix asPath handling for data route revalidation in minimal mode (#36660) 2022-05-03 15:40:36 -05:00
JJ Kasper
3692a5ecdb
Add falling back to wasm swc build on native load failure (#36612)
Follow-up to https://github.com/vercel/next.js/pull/36527 this adds falling back to the wasm swc build when loading the native bindings fails so that we don't block the build on the native dependency being available.  

This continues off of https://github.com/vercel/next.js/pull/33496 but does not add a postinstall script yet and only downloads the fallback when the native dependency fails to load.
2022-05-02 21:11:45 +00:00
Tim Neutkens
5aa54b3385
Add pagesDir to Jest transformer (#36599)
Fixes #35469

Adds `pagesDir` which is required for the Relay transform.

Added a test case based on https://github.com/hanford/relay-swc-jest.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-01 16:39:30 +00:00
JJ Kasper
e30d7237ef
Ensure older lockfile/invalid formats are handled (#36577) 2022-04-29 09:42:48 -05:00
Jiachi Liu
ea81df0a83
Bump react dev dep to 18.1 (#36491)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-04-28 11:29:30 +02:00
JJ Kasper
d66445f800
Ensure optional params are normalized correctly in minimal mode (#36513)
Follow-up for https://github.com/vercel/next.js/pull/36463 this fixes an issue with optional catch-all params not being normalized correctly which was caught by the runtimes tests. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-04-27 18:46:33 +00:00
Javi Velasco
0bf6655f1c
Use edge compiler for middleware (#36486)
* Refactor `path-match`

* Simplify `createPagesMapping`

* Rename `getRawPageExtensions` -> `withoutRSCExtensions`

* Remove unused `functions-manifest-plugin.ts`

* Enable `eval-source-map` for the edge server compiler

* Use Edge Compiler for Middleware & Refactor

* Update some comments

Co-authored-by: JJ Kasper <jj@jjsweb.site>

Update packages/next/shared/lib/router/utils/path-match.ts

Co-authored-by: JJ Kasper <jj@jjsweb.site>

Update packages/next/shared/lib/router/utils/path-match.ts

Co-authored-by: JJ Kasper <jj@jjsweb.site>

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-27 11:50:29 +02:00
JJ Kasper
743cf68555
Pass nextRuntime in webpack context (#36488)
Follow-up to https://github.com/vercel/next.js/pull/36383 this also exposes the `nextRuntime` for the custom webpack function in `next.config.js` to allow differentiating between the environments. 

x-ref: https://vercel.slack.com/archives/CGU8HUTUH/p1647866770704939
2022-04-26 21:05:40 +00:00
JJ Kasper
7e7d7bbca6
Fix incorrect asPath with fallback rewrite in minimal mode (#36463)
This continues off of the change in https://github.com/vercel/next.js/pull/36368 and ensures a fallback rewrite does not influence the `asPath` as these are only matched when a filesystem or dynamic route aren't matched. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

x-ref: https://github.com/vercel/next.js/pull/36368
2022-04-26 19:12:29 +00:00
Jiachi Liu
d5e767b20d
Add process env NEXT_RUNTIME (#36383)
* To help determine the current running environment is in server nodejs / edge runtime
* Remove usage of `process.browser`
2022-04-26 17:54:28 +00:00
JJ Kasper
7c6052a084
Fix failing E2E deployment test cases (#36368)
This continues off of https://github.com/vercel/next.js/pull/36285 fixing some of the failing test cases noticed when running the E2E tests against deployments. After these are resolved the tests will be added to our CI flow after each canary release. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

x-ref: https://github.com/vercel/next.js/pull/36285
2022-04-22 08:00:33 +00:00
Jiachi Liu
d895a50abb
rsc: skip next builtin module when apply loaders (#36202)
x-ref: https://github.com/vercel/server-components-notes-demo/pull/17

Previously in #35975 we ignore handling node_modules as a workaround for 3rd party packages, but for next buildin components we should still handle them for processing client components
2022-04-17 01:38:56 +00:00
JJ Kasper
d24eeb647f
Fix only generated case in minimal mode (#36130) 2022-04-13 15:04:00 -05:00
JJ Kasper
95a8f31d86
Fix outputStandalone with optimizeCss (#36028) 2022-04-11 16:14:28 -05:00