Commit graph

8923 commits

Author SHA1 Message Date
Maia Teegarden
ff5e444284
Use @next scope for native packages (#28046) 2021-08-12 13:59:53 -07:00
Oscar Busk
25df53d19f
next-env.d.ts note in templates (#27983)
Hello! I was using `npx create-next-app --ts` to quickly bootstrap a basic next.js project with Typescript. It bothered me that I got git diff just from running `npm run build` inside the project, because the new notice in the `next-env.d.ts` file.

![image](https://user-images.githubusercontent.com/13413409/129115266-80e00bf3-78aa-40be-bd0f-a18aaa448a68.png)

So I went ahead and updated the `next-env.d.ts` file in [`packages/create-next-app/templates/typescript`](fb67ce9864/packages/create-next-app/templates/typescript/next-env.d.ts) to be exactly how the file looks after running once. (7417ecc09c)

Then I realized that I could probably do the same for all the `next-env.d.ts` that are spread out in the many examples, to make running those examples after cloning them feel a bit smoother. (fb67ce9864)

> However I skipped the [`with-typescript-graphql`](40f85f6d95/examples/with-typescript-graphql) example since that [`next-env.d.ts`](40f85f6d95/examples/with-typescript-graphql/next-env.d.ts (L4-L9)) actually has changes and I couldn't even run `yarn build` in that example, so I'm not sure what will happen with the `next-env.d.ts`. Someone who _gets_ that example will have to fix it I suppose.
2021-08-12 20:36:53 +00:00
Tobias Koppers
8bbb1cd353
use a shared worker pool for collecting page data and static page generation (#27924)
this avoid loading all code twice and hopefully improving performance
2021-08-12 19:54:49 +00:00
Maia Teegarden
b6411408c0
v11.1.1-canary.3 2021-08-12 10:55:41 -07:00
Maia Teegarden
24df675c32
Authenticate npm before publishing native packages (#28041) 2021-08-12 10:55:07 -07:00
Maia Teegarden
2d38efa7b5
v11.1.1-canary.2 2021-08-12 10:21:01 -07:00
Maia Teegarden
f0678979f1
Fix publish native script (#28037)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-08-12 09:46:39 -07:00
Oscar Busk
69d6001c59
Make sure all example packages has private: true (#28008)
Update the `check-exampels.sh` script to also ensure all examples has `private: true` (763d9979f7)

Update exampels (1) that did not have `private: true` (bcdc4a3ae0)
2021-08-12 16:18:41 +00:00
stefanprobst
9bf322503b
Add missing fields to NextConfig type (#27974)
This PR adds the `poweredByHeader` and `webpack` fields to the public `NextConfig` type.

## 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-08-12 15:42:57 +00:00
Tim Neutkens
06e08accde v11.1.1-canary.1 2021-08-12 17:07:36 +02:00
Tim Neutkens
965a280bc2
Ensure config file message is only shown once (#28017)
Fixes #27982



## 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-08-12 14:33:25 +00:00
Anderson Leite
27ccd3cb38
Tests: Execute development-logs tests. (#27996)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-08-12 14:35:54 +02:00
Maia Teegarden
b2c7b316cb
Next swc publish flow (redo) (#27984)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-08-12 12:22:50 +02:00
Delba de Oliveira
40f85f6d95
[Docs] Add testing docs (#27965)
Add a new doc showing how to configure Jest and Cypress with Next.js

## 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
- [x] 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-08-11 20:47:12 +00:00
jj@jjsweb.site
988c0c7fd3
v11.1.1-canary.0 2021-08-11 12:13:30 -05:00
JJ Kasper
f56a1505c2
Fix incorrect error manifest path (#27970) 2021-08-11 12:07:09 -05:00
Tim Neutkens
ce4adfc02d v11.1.0 2021-08-11 17:52:20 +02:00
Tim Neutkens
092a476feb v11.0.2-canary.31 2021-08-11 17:49:46 +02:00
Tim Neutkens
ebb6a30370 Revert "Add warning during next build when sharp is missing (#27933)"
This reverts commit 51a2a028dd.
2021-08-11 17:47:16 +02:00
Tim Neutkens
52486ceccf v11.0.2-canary.30 2021-08-11 15:59:00 +02:00
Tim Neutkens
8ac3254d25 Revert "Next swc publish flow (#27932)"
This reverts commit 94fc6f0832.
2021-08-11 15:48:15 +02:00
Tim Neutkens
6014b6e0f8 v11.0.2-canary.29 2021-08-11 12:46:11 +02:00
Brody McKee
4cd45aabcf
Add rootDir setting to eslint-plugin-next (#27918)
## Introduction

This PR enables setting a `rootDir` for a Next.js project, and follows the same pattern used by [`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject).

## Details

Previously, users had to pass paths to the rule itself.
```js
module.exports = {
  rules: { 
    "@next/next/no-html-link-for-pages": [
      "error",
      // This could be a string, or array of strings.
      "/packages/my-app/pages",
    ],
  },
};
```

With this PR, this has been simplified (the previous implementation still works as expected).
```js
module.exports = {
  settings: { 
    next: {
      rootDir: "/packages/my-app",
    },
  },
  rules: { 
    "@next/next/no-html-link-for-pages": "error",
  },
};
```

Further, this rule allows the use of globs, again aligning with `@typescript-eslint/parser`.
```js
module.exports = {
  settings: { 
    next: {
      // Globs
      rootDir: "/packages/*",
      rootDir: "/packages/{app-a,app-b}",

      // Arrays
      rootDir: ["/app-a", "/app-b"],
      
      // Arrays with globs
      rootDir: ["/main-app", "/other-apps/*"],
  },
};
```

This enables users to either provide per-workspace configuration with overrides, or to use globs for situations like monorepos where the apps share a domain (micro-frontends).

This doesn't solve, but improves https://github.com/vercel/next.js/issues/26330.

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] 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-08-11 10:37:55 +00:00
JJ Kasper
e61ea6f27b
Add manifest check step and add missing items (#27934) 2021-08-11 11:17:57 +02:00
Maia Teegarden
94fc6f0832
Next swc publish flow (#27932) 2021-08-11 11:03:16 +02:00
Steven
51a2a028dd
Add warning during next build when sharp is missing (#27933)
Follow up to #27346 

![image](https://user-images.githubusercontent.com/229881/128935917-ca6da384-91f4-43d3-8059-4e06220fbc19.png)
2021-08-11 04:03:57 +00:00
Gerald Monaco
459b391775
Add experimental concurrentFeatures config (#27768)
Allows opting in to support for new concurrent features, like server-side Suspense.

**!!! DO NOT USE !!!**
This is highly experimental. We **will** be gating additional breaking changes behind this same flag. 
**!!! DO NOT USE !!!**

Also resolves suspense for static pages (i.e. `getStaticProps` or `next build`/`next export`) since we can't currently support streaming for those cases anyway.
2021-08-11 03:06:42 +00:00
C. Lewis
3c837ed175
test(next): add tests for Node-like hashbang support (#27906)
* update to webpack 5.50.0

* feat: use shebang loader shim for now

* chore: snapshot formatting change

* chore: remove unneeded SSR test

* chore: test all file extensions

* chore: remove shebang loader from Webpack config

* chore: revert unnecessary changes

* Update test/integration/hashbang/test/index.test.js

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

* chore: revert changes to yarn.lock

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Steven <steven@ceriously.com>
2021-08-10 21:41:02 -04:00
Alex Castle
12eb812243
Add data-nimg attribute to image component (#27899)
This PR adds a single data attribute to the image element generated by the image component `data-nimg`) which just serves to signal that this image element is from the component. Currently it's hard to quickly/programmatically determine with certainty whether an image is from the component or not, so this change should make it easier for us to diagnose and improve performance issues related to the image component.
2021-08-11 00:58:15 +00:00
Steven
b4be678e35
Remove duplicate type for StaticImageData (#27931)
Follow up to #27916 

This interface was defined twice so I removed the private one and kept the global/public one.

eb871d3091/packages/next/image-types/global.d.ts (L4-L9)

b881d65c12/packages/next/client/image.tsx (L60-L65)
2021-08-11 00:13:35 +00:00
JJ Kasper
83b3ceb8a7
Update release stats job name (#27923) 2021-08-10 16:24:45 -05:00
Tobias Koppers
681d298bdf
update to webpack 5.50.0 (#27929)
* performance improvements for cache serialization
* disabled cache compression by default (next.js is using webpack default again)
* support hashbang
2021-08-10 19:20:50 +00:00
Sam Ko
b881d65c12
Adding a missing a period (#27928)
## 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
- [X] Documentation updated
- [ ] 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-08-10 18:37:34 +00:00
Janicklas Ralph
43393d53be
Fix next/script unhandled promise rejection (#27903)
## Bug

- [x] fixes #27747
- [x] Integration tests added
2021-08-10 17:41:26 +00:00
stefanprobst
eb871d3091
Replace placeholder with blurDataURL in global StaticImageData type (#27916)
I think the global `StaticImageData` type does not currently match what actually gets imported, and what the `Image` component expects (see [here](https://github.com/vercel/next.js/blob/canary/packages/next/client/image.tsx#L60-L65)). This PR changes `placeholder` to `blurDataURL`.

## 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-08-10 15:51:08 +00:00
ahmed osama
0cc4a98041
Little typo (#27911)
## 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-08-10 12:01:14 +00:00
Tim Neutkens
8cbaa409ca v11.0.2-canary.28 2021-08-10 11:01:53 +02:00
Delba de Oliveira
97174ac651
Add with-cypress example (#27900)
This PR adds a with-cypress example to match the examples in upcoming docs. 

## Documentation / Examples

- [ ] Make sure the linting passes

**Note:** This PR does not pass linting because ESLint needs to have the [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress) installed globally to ignore the Cypress methods.
2021-08-09 20:57:17 +00:00
Delba de Oliveira
6a32d854fc
Update with-jest example (#27894)
## Documentation / Examples

- [x] Make sure the linting passes

This PR updates our current with-jest example to match the examples in upcoming docs, add module alias configuration and be more consistent with Jest conventions.
2021-08-09 19:04:27 +00:00
Jiachi Liu
9d3e895124
Upgrade styled-jsx to v4 (#27890)
Upgrade styled-jsx to v4 for supporting concurrent mode in react 18 


## 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-08-09 17:57:11 +00:00
stefanprobst
1969124d07
Add type annotation for NextConfig to CNA typescript template (#27872)
This adds a type annotation for the `NextConfig` type to `next.config.js` in the `create-next-app` typescript template.

## 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-08-09 17:13:30 +00:00
C. Lewis
c9ff4c7989
feat(package.json): add contributor-friendly lifecycle scripts (#27825)
## Feature

I was struggling to get my local dev build working as a local package.json override, and types do not seem to be generated by `yarn dev`, so I had to figure out a cohesive way to build the project start-to-finish (and also clean the project).

Building the project and all types ended up just being `yarn prepublish`, here aliased as `yarn build`, and I added a `yarn clean` script. These two together should make it very difficult for any contributor to be confused how to generate a final build including all type declarations.

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

## Documentation / Examples

b2a888c144/contributing.md (building)
2021-08-09 16:21:16 +00:00
Nick Kelly
b60c943750
Remove extraneous fs.stat calls (#27779)
## Performance improvement

- [x] Performance improvement

Uses `fs.readdir`'s  `withFileTypes` option, added in NodeJS version 10,  to simultaneously read the target directories files and their stats, removing the need to call `fs.stat` on each of the files individually.

Similar to #27769, applies the same change to `recursiveCopy` and `recursiveDelete`.
2021-08-09 15:28:00 +00:00
Tobias Koppers
c6ba688c40
disable cache compression as it slows down the build (#27887) 2021-08-09 14:13:50 +00:00
Tim Neutkens
331fed89f3
Add Import trace for requested module when it fails to resolve (#27840)
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-08-09 14:38:26 +02:00
Nick Crews
0608f493dd
Document that Google has begun using CLS metric (#27843)
Google has begun using Cumulative Layout Shift as a factor in ranking search results, according to the linked Google docs.

This perhaps will make this page out of sync with other Nextjs docs, but I figure better start somewhere.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] 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-08-08 17:52:44 +00:00
Tim Neutkens
04bbea2cbe Add sourceFileName for SWC compiled core files
Fixes the vscode debugger breakpoints. Thanks @kdy1 for implementing the `sourceFileName` option in SWC.
2021-08-06 22:02:08 +02:00
JJ Kasper
e57b959e17
v11.0.2-canary.27 2021-08-06 13:45:57 -05:00
Maia Teegarden
7992b14a78
Add next dynamic swc transform (#27745)
Ported `packages/next/build/babel/plugins/react-loadable-plugin.ts` to swc
2021-08-06 16:53:32 +00:00
stefanprobst
62707d4590
fix eslint plugin install in docs (#27807) 2021-08-06 10:39:47 -05:00