Commit graph

3994 commits

Author SHA1 Message Date
Gerald Monaco
6ba2078b79
Remove obsolete prerender indicator code (#30004)
`isPrerendered` was used for the prerender indicator, which was removed in #18629
2021-10-18 00:27:19 +00:00
Tim Neutkens
ab4b2a9e73 v11.1.3-canary.80 2021-10-17 16:28:33 +02:00
Donny/강동윤
9885ab6282
Update swc to fix minifier (#29989)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-17 16:25:37 +02:00
Tim Neutkens
5edfbf276e v11.1.3-canary.79 2021-10-17 12:18:18 +02:00
Donny/강동윤
7e5391268f
Fix identifier handling ofstyled-jsx (#29986)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-17 12:17:13 +02:00
Tim Neutkens
2a2c1c9ed7 v11.1.3-canary.78 2021-10-17 09:55:07 +02:00
Donny/강동윤
a3fcebc3ee
Update swc (#29969)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-17 09:50:01 +02:00
JJ Kasper
dff6a71e77
Fix config import on Windows and disable test in failing envs (#29971)
Follow-up to https://github.com/vercel/next.js/pull/29935 this fixes the failing tests on Azure as it seems the `import()` needs to be prefixed with `file://` on Windows or an error is thrown. It also disables the config unit tests since a dynamic import inside of `jest` on either an m1 on macOS or Windows using node 14 causes a segfault from being used inside of `vm`. 

<details>

<summary>segfault error in jest</summary>

<img width="962" alt="Screen Shot 2021-10-15 at 16 45 04" src="https://user-images.githubusercontent.com/22380829/137596819-072233e3-1a45-445f-a3dd-c03ec62fb4ce.png">

</details>


<details>

<summary>Windows absolute import error</summary>


<img width="1114" alt="Screen Shot 2021-10-16 at 12 45 59" src="https://user-images.githubusercontent.com/22380829/137597185-200f3164-7f79-488f-acc9-6c812ce5bc4a.png">

</details>
2021-10-16 19:30:00 +00:00
Tim Neutkens
701fa9993f v11.1.3-canary.77 2021-10-16 14:26:21 +02:00
Tim Neutkens
7e370134fb
Use import() to load next.config.js (#29935)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-16 14:22:42 +02:00
Steven
80e5180e05
Update webpack target to node12.22 (#29953)
Follow up to #29949
2021-10-15 22:33:44 +00:00
Steven
fdb2cc80b1
Bump "engines" to node >= 12.22.0 (#29949)
Older versions of Node.js don't have a stable ESM implementation

https://nodejs.org/api/esm.html#esm_modules_ecmascript_modules
2021-10-15 20:55:14 +00:00
Tim Neutkens
73a3a957db v11.1.3-canary.76 2021-10-15 22:13:13 +02:00
Tim Neutkens
cf9eb36e7c Remove unused SWC option 2021-10-15 22:10:18 +02:00
mohamed bel haj youssef
9cf0809b77
Fix Log Typo (#29937) 2021-10-15 13:07:24 -04:00
Tim Neutkens
00431087d7 v11.1.3-canary.75 2021-10-15 17:26:16 +02:00
Donny/강동윤
e844582400
Upate swc to allow line comments in css (#29943)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-15 17:25:31 +02:00
Tim Neutkens
32029ef5e9 v11.1.3-canary.74 2021-10-15 12:45:39 +02:00
Tim Neutkens
e7aa36f133 v11.1.3-canary.73 2021-10-15 12:10:26 +02:00
Tim Neutkens
b24036b7e0 v11.1.3-canary.72 2021-10-15 12:09:30 +02:00
Donny/강동윤
9375c7fe52
Update swc (#29938)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-15 11:39:09 +02:00
Tim Neutkens
bd53816aff v11.1.3-canary.71 2021-10-15 09:17:45 +02:00
JJ Kasper
75748caf7f
Migrate server-sent events HMR connection to WebSocket (#29903)
This replaces the server-sent events HMR connection with a WebSocket connection to prevent hitting browser connection limits, allow sending events back from the browser, and overall better performance. 

This approach sets up the the `upgrade` event listener on the server immediately when created via `next dev` and on the first request using `req.socket.server` when created via a custom server. In a follow-up PR we can push the files changed via the WebSocket as well. 

x-ref: https://github.com/vercel/next.js/issues/10061
x-ref: https://github.com/vercel/next.js/issues/8064
x-ref: https://github.com/vercel/next.js/issues/4495

## 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
2021-10-15 07:09:54 +00:00
Denis Homolík
ea0cdc5a36
Add revalidate to the GetStaticPropsResult (#29919)
Fixes #28687

According to the answer in #28687, `GetStaticPropsResult` should allow specifying `revalidate` next to the `notFound: true`. Right now it's missing in the types def and allows to return any type. Also this may lead to confusion, that `revalidate` can't be used with the `notFound: true`

Example:
```ts
export const getStaticProps: GetStaticProps = async ({ locale }) => {
  const data = await fetchData();

  if (!data) {
    return {
      notFound: true,
      revalidate: new Date() // ts doesn't know the revalidate field and allows this
    };
  }

  return {
    props: { data },
    revalidate: new Date() // ts know the revalidate field, so it doesn't allow this
  };
};
```

## Bug

- [x] 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

- [x] Make sure the linting passes
2021-10-15 02:14:25 +00:00
Tim Neutkens
fd5522d923 v11.1.3-canary.70 2021-10-14 20:15:19 +02:00
Donny/강동윤
e45d1381e5
Update swc (#29913)
## 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
2021-10-14 15:15:23 +00:00
jj@jjsweb.site
0d4d95f5c7
v11.1.3-canary.69 2021-10-14 09:38:52 -05:00
Tim Neutkens
40cf931338
Remove unused options from swc-loader (#29907)
Since this is not a swcrc option and will be removed in the future it's best to prune it from next-swc already.

## 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
2021-10-14 08:50:55 +00:00
JJ Kasper
6f3c338745
Update to latest @vercel/nft (#29902)
This updates to the latest version of `@vercel/nft` which includes better shared caching between runs. 

x-ref: https://github.com/vercel/nft/pull/239
x-ref: https://github.com/vercel/nft/pull/238
x-ref: https://github.com/vercel/nft/pull/237
2021-10-14 06:12:33 +00:00
Kara
5760ceac86
Refactor Document to prep for classic streaming (#29834)
This refactor is the first of a few changes to support "classic" (two-part)
streaming. This one should be a noop that doesn't actually change the behavior.
It re-organizes the way that functions are wrapped in Document Head/NextScript
so anything that will be part of the second flush can be separated out from the
first flush. It also adds the structure for a useMaybeDeferContent hook, but
currently always assumes that nothing should be deferred.

The next PRs will actually implement streaming.
2021-10-13 17:07:18 -05:00
Tim Neutkens
d62253406b
Enable esmExternals by default (#29878)
## 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
2021-10-13 21:11:52 +00:00
Tim Neutkens
d1d7a951d5 v11.1.3-canary.68 2021-10-13 18:56:20 +02:00
Donny/강동윤
bf9e998ae3
Update swc & Improve CI time (#29884)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-13 18:55:35 +02:00
Tobias Koppers
f530b0d312
only listen to drain even once (#29885)
gets rid of `(node:670) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit`
2021-10-13 16:29:52 +00:00
Tim Neutkens
a002f612c3
Add experimental option to enable fullySpecified (#29880) 2021-10-13 17:23:50 +02:00
Tobias Koppers
ecd31ab62f
update webpack (#29870) 2021-10-13 17:21:15 +02:00
Tim Neutkens
9cf49ddf43 v11.1.3-canary.67 2021-10-13 16:27:51 +02:00
Donny/강동윤
b99cfb8cfa
Update swc (#29881)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-13 16:24:31 +02:00
Tim Neutkens
96c2980c77 v11.1.3-canary.66 2021-10-13 13:49:49 +02:00
Donny/강동윤
c3971010f5
Update swc (#29866)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-13 13:45:38 +02:00
Jan Nicklas
31a701b9da
feat(jsconfig-paths-plugin): Resolve paths synchronously (#29467) 2021-10-13 12:17:54 +02:00
Genet Schneider
e40785e1e2
Avoid TypeError when comparing path param (#29821)
## Bug

Fixes a TypeError when accessing url with no path params `_next/data/<BUILD_ID>`
```
TypeError: Cannot read property 'endsWith' of undefined
  at Object.fn (/app/node_modules/next/server/next-server.ts:644:52)
  at Router.execute (/app/node_modules/next/server/router.ts:346:40)
  at Server.run (/app/node_modules/next/server/next-server.ts:1229:41)
  at Server.handleRequest (/app/node_modules/next/server/next-server.ts:489:25)
  at /app/node_modules/next/server/next.ts:47:14
```

- [ ] 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
2021-10-13 04:56:38 +00:00
Steven
bda4ca6ef3 v11.1.3-canary.65 2021-10-12 13:50:38 -04:00
Donny/강동윤
7b3cce3f94
Update swc (#29843)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-12 16:43:45 +02:00
Steven
cc1f3b8a38
Add support for AVIF to next/image (#29683)
Add support for AVIF to `next/image`

- Fixes #27882 
- Closes #27432 

## Feature

- [x] Implements an existing feature request
- [x] Related issues linked
- [x] Integration tests added
- [x] Documentation added
- [x] Update manifest output
- [x] Warn when `sharp` is outdated
- [x] Errors & Warnings have helpful link attached
- [ ] Remove `image-size` in favor of `squoosh`/`sharp` (optional, need to benchmark)
2021-10-11 23:17:47 +00:00
Keen Yee Liau
13f68debfe
Collect feature usage for optimizeCss (#29828)
`optimizeCss` is a feature that inlines critical CSS using critters.
The Aurora team would like to gauge adoption rate for this feature.



## 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`
- [x] Integration tests added
- [ ] Documentation added
- [x] 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
2021-10-11 21:15:18 +00:00
Tim Neutkens
e61068bff6 v11.1.3-canary.64 2021-10-11 20:47:06 +02:00
Tobias Koppers
e679f5b7d1
allow to reload disposed client pages (#29815) 2021-10-11 20:36:01 +02:00
Tobias Koppers
a773e6fc77
handle new hmr connection as heartbeat signal (#29818)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-11 19:49:32 +02:00
Tobias Koppers
7a38bbb4d9
add summary logging option (#29814) 2021-10-11 19:31:12 +02:00