Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] canary from vercel:canary #143

Merged
merged 3,311 commits into from Aug 11, 2022
Merged

[pull] canary from vercel:canary #143

merged 3,311 commits into from Aug 11, 2022

Conversation

pull[bot]
Copy link

@pull pull bot commented May 6, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label May 6, 2022
timneutkens and others added 29 commits July 14, 2022 16:30
* test: added some test cases for new client side router

* tests: added additional test cases

* test: improved test support

* feat: added support for `<Link soft />`

* tests: improved test reliability

* tests: added more cases for catch-all routes

* tests: added app -> pages -> app tests

* tests: add tests for useCookies + useHeaders

* tests: added tests for usePreviewData

* tests: added more tests for hooks and client components

* tests: added tests for query/params handling

* tests: fix tests for param/query to use props

* tests: added some skipped tests for unimplemented features

* tests: linting

* refactor: updated TODO -> TODO-APP

* tests: added some more test cases

* tests: skipped failing test
Follow-up to #38682. Instead of checking if the full element is in the viewport we only check if the top of the element is in the viewport. If it is not we have to scroll back up in cases of navigating between items in the same layout for example.
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Add [bundlejs](https://bundlejs.com/) site - an online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.

The lowercase name is intentional.
* add user check in `auth-with-stytch`.

* Revert "delete auto.js in pollyfills"

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
…js` (#37866)

This updates the `with-sentry` example to use the new helper function `captureUnderscoreErrorException` in its `_error.js` page. This new function both adds more data to sentry events and allows the code to be cleaned up quite a bit.

Fixes #37870.

- [x] Make sure the linting passes by running `pnpm lint`
- [x] 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>
Update the file name in the import statement in the "write server-side code directly" section in the documentation
This fixes the failing test case on canary in the `app-dir` test suite which is caused by the flight-manifest including references to the `pages/index` chunk and it being attempted to be loaded for a page in `app` which causes a webpack error in development. 

This also fixes an error from missing `getDerivedStateFromError` in our error boundary in development. 

## Bug

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

x-ref: https://github.com/vercel/next.js/runs/7360713710?check_suite_focus=true
x-ref: https://github.com/vercel/next.js/runs/7361755629?check_suite_focus=true
x-ref: https://github.com/vercel/next.js/runs/7361755806?check_suite_focus=true
### Changes

#### Add missing virtual client entry matcher for css modules
client entry module has no file path, add the missing file matcher for client css modules loader

#### Use relative paths for imports in client entry to avoid module resolving failure.

if it's `next/head` or other 3rd party installed path, just import it instead of the resolved file path
x-ref: #38235 (comment)

Rewrite ETag generate function with `fnv1a` hash.

FNV hashes are designed to be fast while maintaining a low collision rate. The FNV speed allows one to quickly hash lots of data while maintaining a reasonable collision rate (https://softwareengineering.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed/145633).

[fastify-etag](https://github.com/fastify/fastify-etag) also uses `fnv1a` algorithm by default.

cc @shuding: Should `experimental-edge` also switch to `fnv1a` for ETag, for consistency?
Rather than manually adding the environment variable.
## Bug

x-ref: #38691

* Previous configured loader.issue results into a single function and will bail during next build, tune the rule set conditions to make it work for both pages and app dir
* prefer to use `mod.resourceResolveData?.path` instead of `mod.userRequest` since userRquest contains the applied loaders info

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
* Add dark mode to Create Next App

* Lint create-next-app css

* Widen boxes to optimize linebreaks

* Add color scheme to html, remove layout edits
* Add note about test-trace artifact to test readme

* Add link to valid test modes
…38764)

Fixes #38749

Since we are calling it `API_URL`, it sounds more correct to require including the `/graphql` rather than making `WORDPRESS_API_URL` be just the root domain in https://github.com/vercel/next.js/blob/54f87245dc8a181759a3c8065a35c7fbb1d1d329/examples/cms-wordpress/README.md?plain=1#L96


## 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)
* update fallback docs

* minor update

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
fediev and others added 28 commits August 9, 2022 10:23
)

Improve description of `query`

`query` is not just representing of the query string. It has the same values as `router.query`.
Improve styled-jsx types in next.js, previously there's no `declare module` for styled-jsx and there's type name conflicts in `styled-jsx/index.d.ts` and we use a rename hack to avoid the conflicts. Now styled-jsx 5.0.3 fixed those issues.

x-ref: vercel/styled-jsx#805
This PR updates the documentation for the `sizes` proper in next/image to make it more clear what this prop does and why it's (very) important to use it. After feedback, I'll update this PR to also modify the future image component docs.


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
* Wrap sizes code snippets in component

* Don't remove docs import statement
* feat(middleware): augments / matcher with /index

* fix(#39396): not invoked with i18n and trailingSlash

* add test case

* tweak matcher a bit and add tests

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

* Update `router.prefetch` documentation

Include documentation for setting the locale as an option within `router.prefetch`.

* apply suggestions

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

The link to https://nextjs.org/docs/messages/invalid-getserversideprops-value does not exist, the correct link should be https://nextjs.org/docs/messages/invalid-getserversideprops-return-value

![image](https://user-images.githubusercontent.com/78015359/183795431-53210024-4938-4f50-9f0a-cb412383780e.png)

![image](https://user-images.githubusercontent.com/78015359/183795482-f17f31c2-cbaf-4652-ad77-5294fa8f104a.png)

# Solution

## From

Referring to the pattern, there is no `return`

![Screenshot from 2022-08-10 10-04-33](https://user-images.githubusercontent.com/78015359/183795393-ba244d6a-84b3-426c-b5ef-4e17d108902a.png)

## To

So I removed the word `return` to match the pattern

![image](https://user-images.githubusercontent.com/78015359/183796280-da6f10d1-c017-4075-942a-01d9ad234c27.png)


## Bug

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

## Documentation / Examples

- [x] 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>
This version fixes a bug where [crypto buffers (ArrayBuffer, Uint8Array) not compatible with text decoding](vercel/edge-runtime@17475e4).
### 📖 What's in there?

As part of the 4 hands work done in #39397, we accidentally removed a describe for middleware "using a single matcher with i18n" (and no base path nor trailing slash).

This PR restores it.

### 🧪 How to test?

```
pnpm testheadless --testPathPattern middleware-matcher
```

### 🆙 Note to reviewers

There's only a couple lines with meaningful change in this PR. Hide whitespaces in github's diff screen to find it more easily: https://github.com/vercel/next.js/pull/39452/files?diff=split&w=1
Found that this rule was added but all options are set to `false` so it doesn't do anything. Started with enabling it for examples to ensure minimal breaking of existing PRs.

## 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)
* Ensure default _app is used when falling back to default _error

* make render check less specific due to arbitrary wait
This ensures we properly handle rewrites when the request is a WebSocket request. This also adds an integration test to ensure it is working as expected in dev and production mode. 

## Bug

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

Fixes: #32634
Closes: #38455
## 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: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
* Tweak styled-jsx type declarations

* fix lint
The [comparison table for migration](https://nextjs.org/docs/api-reference/next/future/image#migration) to `next/future/image` looks odd layout-wise. The issue was brought up via this [Slack thread](https://vercel.slack.com/archives/C02F56A54LU/p1660040275310949).

This PR makes this improvement.

### New implementation

<img width="1216" alt="image" src="https://user-images.githubusercontent.com/12712988/183631902-6850836b-cb4e-44ea-909f-ba353725be15.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 `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: Steven <229881+styfle@users.noreply.github.com>
* Fix swc build for freebsd target

* test build

* update build

* update version

* test v0

* use napi directly

* revert vm version

* undo test build
## Bug

- [fixes #39035 ] 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: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
* Add hot-reloading for env file changes

* update watching

* update test

* update initial env handling

* undo test change

* add comment for entries clearing

* update on-demand-entry-handler restart handling

* lint-fix

* handle bad plugin
* Feat: Add Kebab case

* Add document

* Feat: Add Kebab case

* Add document

* Add Test cases
## 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`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Changes

Added in on-demand revalidation for Contentful example. Specifically, added the revalidate api path, a new environment variable which will contain the secret, and some additions to the README.


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment