Commit graph

11042 commits

Author SHA1 Message Date
JJ Kasper
b8f7c520da
v12.1.6-canary.5 2022-04-21 10:07:37 -05:00
JJ Kasper
6da71321df
Ensure beforeFiles client-side resolving handles dynamic routes (#36317)
This fixes resolving `beforeFiles` rewrites with `next/link` as previously we weren't resolving the destination to a dynamic route since the resolving was being marked as finished when it shouldn't be during `beforeFiles`. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/35402
2022-04-21 14:58:43 +00:00
await-ovo
864d401ee1
fix(next): use moduleGraph.getIssuer to avoid deprecation warning (#36329) (#36330)
fix: #36329 



## 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 by running `yarn lint`
2022-04-21 14:14:03 +00:00
Donny/강동윤
9456fc6b3b
Update swc (#36269)
This PR updates swc crates to 33e4661090



I'll undraft this after verifying some more fixes.


 - Resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2587218
<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163984412-cd887458-9507-4f20-9fd9-e0864d3904d7.png">


 - Resolves https://github.com/vercel/next.js/discussions/30237#discussioncomment-2585357


<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163990124-10c7dc62-7613-444b-bffd-69b69c880592.png">
2022-04-21 10:52:39 +00:00
Jiachi Liu
2bdf1bc023
Use fallbackable path module for node and edge runtime (#36306)
x-ref: #36190
x-ref: #31506

* Move nodejs ptah module usage to next-server, keep base-server and web-server headless for `'path'`
* Use a native module `path` for nodejs runtime and `path` polyfill for edge runtime
2022-04-21 09:07:03 +00:00
残月
9fe2f2637c
feat:Add support for useDefineForClassFields typescript option (#36335)
* feat:Add support for useDefineForClassFields typescript option

* test:add test for useDefineForClassFields option

* test: fix lint error
2022-04-21 10:41:09 +02:00
Najmus Sakib
084a0ca929
Removed unnecessary React Fragment (#36331)
## Update
[-] Removed React fragment from index
2022-04-21 08:37:37 +00:00
JJ Kasper
b5d9ce5559
Add client HMR tracing for debugging (#36328)
This adds client HMR event tracing to help debug the client state for reproductions easier
2022-04-21 08:30:23 +00:00
Joshua Davis
5a93e211cb
Clarifies that path params exist on query object (#36321)
Clarifies that the query object contains query and dynamic path parameters. As I was helping another engineer, I tried to reference this documention. I thought the routing page would be a more useful reference if it indicated how to read path parameters.



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

- [x] Make sure the linting passes by running `yarn lint`
2022-04-20 23:04:43 +00:00
Michael Novotny
52fefb13e2
Adds removeListener handler to with-electron-typescript example. (#36323)
Without removing the listener in `useEffect`, the home / index page will keep adding a new listener each time you come back to the home page.

![CleanShot 2022-04-20 at 15 38 44](https://user-images.githubusercontent.com/446260/164318945-f1779c57-ff30-437b-8914-961cd6ebc176.gif)
2022-04-20 20:54:33 +00:00
Tim Neutkens
23c82e42af
next/jest: Allow moduleNameMapper to match before Next.js internal mappings (#36312)
Fixes #35634

This change doesn't require tests as importing svgs is not a supported feature, this just makes it slightly more ergonomic to override the matchers. 



## 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`
2022-04-20 14:54:38 +00:00
JJ Kasper
073a05a1be
Add handling for testing against deployments (#36285)
This adds a new test mode `next-deploy` which allows testing against deployments using the Vercel CLI. After running these tests they uncovered some bugs we need to correct before fully enabling. Patching the uncovered issues will be done in follow-up PRs and then after resolved this will be enabled to run after new publishes. 

Tests that uncovered bugs to patch in follow-ups:

- [ ] test/e2e/getserversideprops/test/index.test.ts (req.url normalizing)
- [ ] test/e2e/i18n-api-support/index.test.ts (locale prefixed API routes matching)
- [ ] test/e2e/prerender.test.ts (/_next/data/build-id/ does not 404)
2022-04-20 12:23:09 +00:00
JJ Kasper
bf405c38eb
Ensure error is cleared for missing global css (#36292)
This ensures we strip ansi encoding from serialized errors as it causes the error to be illegible when rendered. This also adds a test for global CSS import being missing and then fixed. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-04-20 12:03:48 +00:00
OJ Kwon
af23248627
feat(trace): next/trace to event format converter (#36281)
This PR adds a small utility script for the existing `next/trace` converts emitted output into chromium's trace event format (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?mode=html#). Converted output can be loaded in a couple of visualizers that understand trace event format. 

- `chrome://tracing`
- `https://ui.perfetto.dev/`

Technically it is possible to make generated event format to be compatible to chrome devtool's profiler as well, but that is not dealt with initial implementation.

This is very straightforward, naive conversion between generated trace to the specific format instead of trying to augment existing traces: in result, some of the values are dummy (pid, tid, category). Depends on usecases we can potentially expand & correct later if needed.

Below screenshot is perfetto from `bench/nested-deps`.

<img width="1166" alt="Screen Shot 2022-04-19 at 10 35 28 AM" src="https://user-images.githubusercontent.com/1210596/164062522-4d34a8c0-d66a-4c9e-9e15-08e0cd6d41a7.png">

## 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`
2022-04-20 08:06:52 +00:00
Steven
835aeae1cb
Add telemetry for image config formats (avif/webp) (#36289)
This PR adds telemetry for image config formats since AVIF is opt-in (#30180).

See docs https://nextjs.org/docs/api-reference/next/image#acceptable-formats
2022-04-19 22:47:23 +00:00
Matheus Martins
91fd5971d6
docs: add yoga to examples (#36253)
## Description

The Yoga design system follows design guidelines specification, we developed a React and React Native UI library that contains a set of high-quality components that defines our interfaces.

- https://github.com/Gympass/yoga
- https://gympass.github.io/yoga/

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

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-04-19 22:27:14 +00:00
Daniil Grishkin
49820daca6
Fix introduction.md for next.config.js (#36286)
Fix line in link to interface `NextConfig` where describe `next.config.js` properties.



## 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`
2022-04-19 20:35:49 +00:00
Shu Ding
3e8099e680
Fix flight loader (#36282)
* make sure `left` is defined
2022-04-19 20:14:30 +02:00
Shu Ding
90d3478c52
Use renderToStaticMarkup to render documentHTML (#36213)
There wasn't a strong reason to choose `renderToStream` over `renderToStaticMarkup` for the document wrapper. But due to problems like #35870, we can switch back to the static renderer for now.

Fixes #35870.

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

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-04-19 17:20:20 +00:00
Tim Neutkens
0e2fd9280a v12.1.6-canary.4 2022-04-19 14:44:21 +02:00
Sean Parmelee
ffdb9f847f
fix type definition for defaultGetInitialProps (#36252)
## Bug

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

This PR fixes #36247 by adding the optional `options` object to the type definition for `DocumentContext.defaultGetInitialProps`.
2022-04-19 12:37:57 +00:00
OJ Kwon
deb82802a4
fix(next-swc/ssg): less aggressive exports drop (#36199)
This PR attempts to fix #31855, by loosening conditions to determine what to drop when swc runs transform. Currently, it drops all the export declaration if it's being referenced only in getstatic* in local scope. But as `export` implies, there's no guarantee given export will be used in other modules even if it's not being used in local scope. PR tries to not to drop exports declarations as much if it's not being used locally other than getstatic*. This makes dropping bit ineffecient, but as long as we can't cross-ref across modules that's something unavoidable in my opinion.

I don't think implementation itself is quite acceptable: probably need review & revise to the logics. 

## Bug

- Attempt to close #31855

- [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 by running `yarn lint`
2022-04-19 12:13:57 +00:00
David Barker
44c7fd7999
Add onLoad gotcha note to basic-features doc (#36261)
#33097 adds a note to the `Script` documentation explaining that `onLoad` cannot be used with the `beforeInteractive` strategy. However, this note was missing in the [Basic Features](https://nextjs.org/docs/basic-features/script) documentation, causing some confusion. This adds the note there too.

This will hopefully fix a lot of confusion noted in https://github.com/vercel/next.js/issues/33191.
2022-04-19 11:50:19 +00:00
JJ Kasper
4a8a3d2400
Update CI cache key to allow re-running only failed (#36249)
Previously we made the cache key specific to each run attempt to allow having a separate cache in case a previous build cache was incorrect but now that actions allow re-running only failed it seems more beneficial to allow re-using the build cache for the re-run and for cases where the build cache is incorrect a `bump` commit can be done instead.
2022-04-18 19:09:51 +00:00
Forrest
562e4283f9
Use finally to clean up seen requests (#36222)
* try-finally for router execute request references

* lint

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-18 13:16:39 -05:00
Jiachi Liu
2e00eb6746
Validate streaming writer chunk type in testing (#36200)
* Validate streaming writer chunk type in testing

* call

* update text
2022-04-18 16:24:06 +02: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
e80c48e009
v12.1.6-canary.3 2022-04-16 11:15:20 -05:00
Sukka
a001153c8b
perf(escapeStringRegexp): test before replace (#34472)
## 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

- [x] Make sure the linting passes by running `yarn lint`
2022-04-16 05:42:10 +00:00
Alex Page
3130ed7d48
404 page - Responsive color scheme (#32113)
* Responsive color scheme 404 page

* correct styles

* typo

* consistent spacing

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-16 00:05:48 -05:00
JJ Kasper
63230ebce2
Fix build activity indicator position (#36208)
* Fix build activity indicator position

`devIndicators.buildActivityPosition` introduced in
https://github.com/vercel/next.js/pull/30109 needed more tweaks to properly
position the build indicator container. The build indicator was being rendered
off screen when set to a non-default position.

* Refactor stuff for smaller diff

* add config validation

* Apply suggestions from code review

Co-authored-by: Martin Šťovíček <martin.stovicek@monitora.cz>
2022-04-15 23:53:00 -05:00
Björn
f73e7d51ad
Improve NextApiHandler type for early returns (#35166)
I would like to be able to write handlers with early returns like this:

```typescript
import { NextApiHandler } from 'next'

const handler: NextApiHandler = (req, res) => {
  const value = getStuff()
  if (value === 'branch') {
    return res.json({}) 
  }
  res.status(400)
}
```

but `NextApiHandler`'s current return type is `void | Promise<void>`, which causes compilation to fail with

```
Error:(11, 3) TS2322: Type '(req: NextApiRequest, res: NextApiResponse<any>) => Promise<NextApiResponse<any> | undefined>' is not assignable to type 'NextApiHandler<any>'.
  Type 'Promise<NextApiResponse<any> | undefined>' is not assignable to type 'void | Promise<void>'.
    Type 'Promise<NextApiResponse<any> | undefined>' is not assignable to type 'Promise<void>'.
      Type 'NextApiResponse<any> | undefined' is not assignable to type 'void'.
        Type 'NextApiResponse<any>' is not assignable to type 'void'.
```
to avoid that the above snippet needs to be written as

```typescript
  if (value === 'branch') {
    res.json({}) 
    return
  }
```
which looks odd to me. Changing the return type of `NextApiHandler` to `unknown | Promise<unknown>` would allow for shorter early returns and still communicates to users that nothing is expected to be returned from a handler.

Augmenting the type like this, makes the first snippet work:
```typescript
import { NextApiRequest, NextApiResponse } from 'next'

declare module 'next' {
  export declare type NextApiHandler<T = any> = (
    req: NextApiRequest,
    res: NextApiResponse<T>
  ) => unknown | Promise<unknown>
}
```



## 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`
2022-04-16 04:00:52 +00:00
Kiko Beats
8f8e497e1b
fix(NextResponse.json): pass options (#35367) 2022-04-15 22:23:42 -05:00
Jim Fisher
a2e65ac6d8
Docs: workarounds for router not resetting state (#35651)
* Docs: workarounds for router not resetting state (fixes #35138)

* Apply suggestions from code review

* updates

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-15 21:56:38 -05:00
Sukka
3ae571d97b
refactor(build): no force transpile optional chaining / nullish (#35976) 2022-04-15 21:48:43 -05:00
Jiachi Liu
fe6e74dc57
Fix missing _app component of AppTree in gIP context (#36206)
## Bug

The custom app is missing in the `ctx.AppTree` that causing the issue, it was accidently missed in custom _app.server pr #35666

Fixes #36198

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2022-04-16 01:55:16 +00:00
JJ Kasper
9c7311b1a5
v12.1.6-canary.2 2022-04-15 14:08:42 -05:00
Bartłomiej Krakowski
90d30cd2c9
docs(examples/with-emotion-swc): update readme (#36197)
This PR fixes the wrong path to creating an app using the `with-emotion-swc` example.

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

- [x] Make sure the linting passes by running `yarn lint`
2022-04-15 18:50:29 +00:00
JJ Kasper
9c68aa7c7a
Stabilize flakey build-output test (#36195) 2022-04-15 13:43:50 -05:00
Steven
4c15f89b53
Add support for tsconfig moduleResolution node | node12 | nodenext (#36189)
- Fixes #35572 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-04-15 17:09:12 +00:00
JJ Kasper
1c20d3d071
Stabilize flakey prerender test (#36193) 2022-04-15 11:49:06 -05:00
Basant
ec7c911295
fixed typo, that should say 'in' not 'from' (#36046)
we can import server or client components in any server component, not from it.



## 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: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-04-15 15:34:21 +00:00
YOSHIKI
84d97b1b82
[eslint-config-next] Update @typescript-eslint/parser to v5.19.0 (#36156)
fixes #35784

## 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 by running `yarn lint`
2022-04-15 15:27:17 +00:00
Steven
4c872cb2dc
Fix next/image usage in most cases of onLoad() (#36176)
Even though we never documented it, the `onLoad` prop used to work (in most cases) in Next.js 12.1.4 and broke in 12.1.5 once the code was refactored in PR #35889.

We still shouldn't document it because `onLoad` doesn't work in all cases so [`onLoadingComplete`](https://nextjs.org/docs/api-reference/next/image#onloadingcomplete) is preferred, however tests were added for the cases that do work.

Use cases that don't work with `onLoad` are Data URLs as well as `loading="eager"`.
2022-04-15 15:02:23 +00:00
Donny/강동윤
cbb64ee554
Update swc (#36187)
This PR updates swc crates to b8d9a58f13


- Closes #35811
- Closes #34811
  - I tested with https://github.com/balazsorban44/issue-34811

<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163574875-d7392c4c-b1f1-4503-aac1-35a26c9d7ec2.png">

- Closes #34715
  - I tested with https://github.com/cungminh2710/nextjs-swc-mapbox

<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/163574677-9733dd69-9938-4e3e-b2f1-bfbd6db9e20c.png">


 - This fixes the bug reported in the comment (https://github.com/vercel/next.js/issues/36127#issuecomment-1099794402), but I didn't test the issue itself.
2022-04-15 14:34:32 +00:00
Tim Neutkens
1582e11185
Fix res.json support for string / null (#36186)
Continuation of #33592 with updates tests / changes.

Co-Authored-By: Balázs Orbán <info@balazsorban.com>

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-04-15 16:04:00 +02:00
Eric Burel
e69820accc
Loosen the "public" condition on getSSP (#36018)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order 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 that you're making:
--

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
** I've made the change via GitHub UI sorry :)**

Hi, 

I think the "data must be public" condition on getSSP is not really true, and even counter-productive. Being able to statically render more content is most probably positive, in terms of perceived and real performance of the app + energy consumption. It's actually totally possible, and not even that hard thanks to middleware, to statically render custom, paid, segment-specific content (and even individual-specific content under certain conditions).

I've documented the reason for this change in a few places if you want more details:
- related PR on React: https://github.com/reactjs/reactjs.org/pull/4566
- demo implementation and explanation on how to couple middlewares and getSSP to statically render any kind of content (including custom content): https://blog.vulcanjs.org/render-anything-statically-with-next-js-and-the-megaparam-4039e66ffde
2022-04-15 13:23:32 +00:00
Michael Ward
1be5f36123
Adds linting rule to avoid assignment to 'module' variable. Fixes #34859 (#35279) 2022-04-15 14:45:53 +02:00
Balázs Orbán
c0f979b5c8
Update upgrading.md (#36091) 2022-04-15 14:43:26 +02:00
Aman Mittal
4726b5a618
Add instructions to create pages directory and add an index.js file to it (#35971)
* Update from-create-react-app.md

* Update from-create-react-app.md

* Fix typo

* Update docs/migrating/from-create-react-app.md

Co-authored-by: Lee Robinson <me@leerob.io>

* Update docs/migrating/from-create-react-app.md

Co-authored-by: Lee Robinson <me@leerob.io>

* Update from-create-react-app.md

* fix lint-language issue

* Update .alexrc

* Update docs/migrating/from-create-react-app.md

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

* Update from-create-react-app.md

* Update docs/migrating/from-create-react-app.md

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

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2022-04-15 14:40:37 +02:00