Commit graph

9174 commits

Author SHA1 Message Date
Tim Neutkens
c39b7d19bd
Update next-swc binaries (#29140)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-16 15:47:46 +02:00
강동윤
2c82615bde
Fix transform of ` in styled-jsx (#29136) 2021-09-16 15:08:42 +02:00
Ty Mick
c7e187f893
Add client-side debugging instructions (#28815)
Fixes #16442

The current instructions on the Debugging page currently only work for server-side code, and furthermore, the page doesn't actually _say_ that they only work for server-side code.

This update adds instructions for debugging client-side code in both VS Code and Chrome DevTools. It also improves the suggested VS Code launch configurations to take advantages of some relatively recent features in VS Code's [built-in JavaScript debugger][1]. Using the `node-terminal` and `pwa-chrome` launch types removes the need to manually pass an `--inspect` flag to the underlying Node.js process.

[1]: https://github.com/microsoft/vscode-js-debug

Let me know if there are any edge cases I didn't consider with these VS Code launch configs!



## Documentation / Examples

- [x] Make sure the linting passes
2021-09-16 07:07:56 +00:00
Tim Neutkens
c491adfe12 v11.1.3-canary.19 2021-09-16 08:59:20 +02:00
Tim Neutkens
172a536c61
Update next-swc binaries (#29132)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-16 08:58:36 +02:00
Maia Teegarden
c6cec752c7
Fix partial one off global selectors (#29128) 2021-09-16 08:16:10 +02:00
JJ Kasper
e313398468
Update trace ignores for next import (#29119) 2021-09-15 15:00:52 -05:00
Tim Neutkens
1f788b5430
Development tracing improvements (#29076) 2021-09-15 20:06:24 +02:00
JJ Kasper
85b8399856
Remove log from failing to parse source map (#29118)
This removes the log when we fail to parse the source maps in the `wellknown-errors-plugin` since this log isn't really actionable by users and clutters the error output. 

x-ref: https://github.com/vercel/next.js/issues/27783#issuecomment-915654054
2021-09-15 17:53:22 +00:00
Janicklas Ralph
73408211aa
Remove inert font tag in font optimization (#28869)
* Remove inert font tag in font optimization

* Fix lint

* Remove inert font tag during font optimization

* Fix lint

* Fix lint

* Fix lint

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-15 11:43:13 -05:00
Tim Neutkens
807beac580 Merge branch 'canary' of github.com:vercel/next.js into canary 2021-09-15 17:34:47 +02:00
Tim Neutkens
4b41b48a8e v11.1.3-canary.18 2021-09-15 17:34:32 +02:00
Lee Robinson
dd4215b81e
Update Redux example to use Toolkit + update dependencies. (#29104)
After talking with markerikson, I've made some updates to the Redux examples:

- Updated the `with-redux` example to use the Redux Toolkit + TypeScript example
- Updated dependencies of `with-redux` to work with latest testing setup
- Removed `with-redux-toolkit` in favor of `with-redux`
- Removed `with-redux-toolkit-typescript` in favor of `with-redux`
- Removed `with-redux-code-splitting` in favor of `with-redux`
2021-09-15 15:34:31 +00:00
JJ Kasper
6a9cda5726
Ensure browser instances are not re-created un-necessarily (#29091) 2021-09-15 10:03:33 -05:00
Tim Neutkens
ae305f6aa9
Update styled-jsx (#29103)
Includes a fix for when a tree is rendered without the styled-jsx registry being provided. It'll noop in this new version.

## 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-09-15 14:19:20 +00:00
Tim Neutkens
ca27e34167 v11.1.3-canary.17 2021-09-15 09:32:44 +02:00
Maia Teegarden
4a2d5a1b49
Add/styled jsx swc (#29005)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-09-15 09:24:31 +02:00
jj@jjsweb.site
2cfdc68650
v11.1.3-canary.16 2021-09-14 16:05:21 -05:00
JJ Kasper
49c99cc323
Fix host segment replacing for custom routes (#29090)
This fixes segments inside of the host of the destination failing to parse with url.parse due to the unexpected colon by escaping the colon for segments and then unescaping them after we have parsed the URL.

## Bug

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

x-ref: https://github.com/vercel/vercel/pull/6713
2021-09-14 20:13:46 +00:00
Tim Neutkens
7d664d5b36
Add stats config for SWC (#28883)
* Add stats config for SWC

* Remove stats for deprecated mode

* Include native binaries in local linking

* Expose minify in next-swc

* Build next-swc binaries

* Only upload changed binary artifact

* Build next-swc binaries

* Expose minify in js binding

* Use new minify function in terser plugin

* Build next-swc binaries

* Build next-swc binaries

* Build next-swc binaries

* Pass pagesDir option to SWC for next/dynamic

* Build next-swc binaries

* Add spans for next-trace-entrypoints-plugin

* Fix linting

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
Co-authored-by: padmaia <padmaia@users.noreply.github.com>
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-14 18:13:11 +02:00
Tobias Koppers
0e29a2d08f
reload the page to show 404 when receiving invalid event from on-demand-entries (#29074) 2021-09-14 17:11:00 +02:00
Jeff Wen
07fe406bd5
Add crossOrigin type to the NextConfig (#29033) 2021-09-14 09:51:10 -05:00
Maia Teegarden
a784d54ab5
Fix/upload binary artifact (#29069)
* Fix upload of binary artifacts

* Build next-swc binaries

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-13 16:40:06 -07:00
Kara
41484f62cc
Throw error if res is accessed after gSSP returns (#29010)
* Throw error if res is accessed after gSSP returns

Currently it's possible to access the `ServerResponse` through `context.res`
in `getServerSideProps()`. If one was to store that response and mutate
its headers or status code after gSSP returns (e.g. during rendering), it
would currently happen to work because of when headers are sent. However,
this is an anti-pattern that relies an implementation detail of the framework
and shouldn't be allowed. This will be particularly important once Next.js
starts to support basic streaming (two-part flush: routing then data) because
then the headers will be sent as soon as gSSP returns, which explicitly breaks
this pattern.

With this commit, the framework now throws an error in development mode if
the ServerResponse is accessed after gSSP returns.

* fixup! Throw error if res is accessed after gSSP returns
2021-09-13 17:10:46 -05:00
Lee Robinson
a5bc3f2f8c
Add note about using Sharp for next/image to deployment docs. (#29067)
I also removed the custom server link here, because I think it's making too strong of a correlation between custom server and Node.js server using `next start`, which aren't the same.
2021-09-13 20:31:04 +00:00
Konstantin Popov
16c3e6f613
Fix minor typo in index.test.js (#29065)
Fix minor typo:

suits -> suites
2021-09-13 14:56:56 -05:00
JJ Kasper
0a6ae5c3c2
Remove extra macOS test workflow (#29064)
This is a follow-up to https://github.com/vercel/next.js/pull/29060 removing the `test_macos` workflow since it is redundant to run these tests in macOS as it should be very unlikely the tests fail in the mac environment but pass in the ubuntu environment. It also seems the snapshot tests are incorrect inside of the GitHub actions macOS environment so these tests will not work correctly anyways.
2021-09-13 18:40:17 +00:00
Houssein Djirdeh
01d3539b04
[Examples] Updates with-google-tag-manager example to use <Script> component (#29061)
Updates the `with-google-tag-manager` to use Next.js' Script component with strategy set to `afterInteractive`

CC @janicklas-ralph 

Closes: https://github.com/vercel/next.js/issues/26507
2021-09-13 17:43:35 +00:00
JJ Kasper
ce870babb7
Update test workflows for mac/react (#29060)
* Update test workflows for mac/react

* share timings as well

* update macos
2021-09-13 12:13:22 -05:00
JJ Kasper
e49829bb8e
Fix webpack version and safari test and update compiled (#29059)
* Fix webpack version and safari test and update compiled

* Update compiled again
2021-09-13 10:56:07 -05:00
Tim Neutkens
c1e5f5b260
Make traces in development reliable (#28990)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2021-09-13 15:49:29 +02:00
volcareso
48b37ede23
Add more examples of static generation to docs page. (#29052)
## 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-09-13 13:18:31 +00:00
JJ Kasper
a92a5caec2
Update test set-up to leverage playwright when able to (#28634)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-13 14:36:25 +02:00
강동윤
fd2af1422d
next/dynamic: Accept pagesDir (#29055)
* Add pages_dir

* Add `pages_dir` to `next/dynamic` pass

* Dep

* Fix next/dynamic psss

* Fix

* Update test refs

* Add a test
2021-09-13 13:37:07 +02:00
강동윤
c38e702347
Make next-ssg optional (#28862)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-09-13 12:20:38 +02:00
Tim Neutkens
9572b30849
Deprecate webpack 4 support (#28840) 2021-09-13 09:18:04 +02:00
Konstantin Popov
93bac0f2b7
Fix minor typo in no-img-element.md (#29027)
Fix minor typo: 

image optimization -> Image Optimization
2021-09-12 00:39:43 +00:00
Oiva Eskola
c78b249c66
Fix falsy values not being returned in post fields (#29011)
I imported a bunch of old markdown posts to the blog-starter example but some of the post metadata was not returned by the API in the example code.

For example, having `published: false` in post metadata was not returned in the item fields.

The problem was in check:
```
if (data[field]) {
  items[field] = data[field]
}
```
This rejects all falsy values in addition to fields that are not set. Checking only for `undefined` should fix this issue.

I didn't find existing integration tests for the blog example nor an issue describing this problem.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-09-11 14:24:24 +00:00
Maia Teegarden
0d0f34ba18
Pass code as buffer to swc minify (#29009)
This should fix this: https://github.com/vercel/next.js/pull/28883/checks?check_run_id=3560578176#step:4:353



## 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-09-11 00:57:01 +00:00
Gerald Monaco
1f99c3009f
Use Writable instead of Observable (#29007)
Use `Writable` instead of `Observable` and remove the `zen-observable` dependencies. I initially opted to use `Observable` for simplicity and fast iteration, but we should really just use `Writable` directly (or some other stream in the future).

React's streaming SSR has some [specific requirements](https://github.com/reactwg/react-18/discussions/66#discussioncomment-944266) on the stream API. Rather than trying to also squeeze a `Readable` in here, which might be more standard for node apps, I've just followed React's lead. By limiting ourselves to just `Writable`, it ought to be easier to adopt a different stream type in the future if desired.

The React `pipeToNodeWritable` API requires us to pass a stream immediately, but we don't actually have a `ServerResponse` to give it until `RenderResult.pipe(...)` is called later. For that reason, we pass React a `Writable` that we will simply forward to `res` later. This mechanism of deferring is `NodeWritablePiper`, which is just a function that can be called with `ServerResponse` (or another `Writable`, as we now do to render to string for static results) to have content written to it. `NodeWritablePiper` takes a `next` argument so that we can chain both synchronous and asynchronous pipers together.

Also does some clean up and adds another streaming test for backpressure.
2021-09-11 00:17:56 +00:00
Kara
c27e3a41dc
Update gSSP type to support props as a promise (#28999)
In a previous PR, `getServerSideProps` was altered to support returning
`props` as a promise. This change updates the TS types to permit promises
as well, so you can write type `GetServerSideProps<Props>` instead of
`GetServerSideProps<Promise<Props>>`. e.g.:

```typescript
type Props = {
  data: string
}

export const getServerSideProps: GetServerSideProps<Props> = async (
  context
) => {
  return {
    props: (async function () {
      return { data: 'some data' }
    })(),
  }
}
```

## 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
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`
2021-09-10 19:36:40 +00:00
volcareso
e09b7a5827
Fixed typo (#28989)
Added () outside *demo"



## 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-09-10 12:18:43 +00:00
Tim Neutkens
5fed96dd88 v11.1.3-canary.15 2021-09-10 11:20:55 +02:00
JJ Kasper
a00de0c2f0
Ensure cache-control is correct for notFound: true with revalidate (#28973)
This ensures we have the correct `cache-control` header when `revalidate` is used with `notFound: true` on `getStaticProps` or `getServerSideProps` pages. 

## Bug

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

Fixes: https://app.clubhouse.io/vercel/story/23445
2021-09-10 08:15:13 +00:00
JJ Kasper
6674e977b7
Fix create-next-app tests from example change (#28972) 2021-09-09 15:21:56 -05:00
Maia Teegarden
63e71b585d
Update swc in next-swc (#28970)
* Update swc in next-swc

* Fix typo

Co-authored-by: Steven <steven@ceriously.com>

* Build next-swc binaries

Co-authored-by: Steven <steven@ceriously.com>
2021-09-09 20:02:57 +02:00
Nwachukwu Daniel (DONSN)
248c6fc88d
Fixed issue with grammar (#28964)
Changed - function component to - functional component in the heading and sentence below:

If the child of `Link` is a functional component, in addition to using `passHref`, you must wrap the component



## 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-09-09 14:24:01 +00:00
Rishabh Poddar
60748e3aef
Updates supertokens-node dependency version (#28916)
We update the dependency version to v7.0.0 and make a few code changes to work with the new version
2021-09-09 13:33:50 +00:00
강동윤
a84389591d
Update swc (#28946)
## 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

- [ ] Make sure the linting passes



I updated rust dependencies and node dependencies.
2021-09-09 09:30:22 +00:00
Adrien HARNAY
2abc4f2d6a
Support node-sass@6 (#28710)
* support node-sass@6

* bump sass-loader

* Update precompiled

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-09 11:00:19 +02:00