Commit graph

43 commits

Author SHA1 Message Date
Leah
15215d4c96
ci: report daily turbo integration test results from this repo (#58965)
### What?

A follow up for #58267 and #58394.

We no longer need the git branch for history it's stored in datadog now
and we also decided that we no longer need slack reporting.


Closes PACK-2039

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-12-04 16:18:42 +01:00
Will Binns-Smith
9ac463b218
Remove next-dev and its test suite and benchmarks (#55983)
We've rearchitected Next.js+Turbopack so Turbopack does not run
reimplement pieces of Next.js in its devserver. This:

- Removes the `next-dev` binary, which is no longer reachable through
`next --turbo`.
- Removes its test suite, as much of it is tested (and often more
thoroughly) by the Next.js test suite
- Removes its benchmark suite, which should be covered by
`Turbopack-bench` by
https://github.com/vercel/turbo/tree/main/crates/turbopack-bench

Test Plan: CI


Closes WEB-1652
2023-09-26 05:22:39 +02:00
Balázs Orbán
d5c35a1bbb
chore: replace issue triaing actions with nissuer (#55525)
### What?

Moving maintenance to a separate repository.

### Why?

I want to make these actions reusable in other projects as they seem to work well in the Next.js repository.

### How?

The code is moved to https://github.com/balazsorban44/nissuer

I tested it on my fork, and all the following functionality is preserved: https://github.com/balazsorban44/next.js/issues/56

- [x] Close/lock/comment without a valid reproduction link
- [x] Minimize "+1"
- [x] Add labels based on user selection
- [x] Add comment based on the maintainer's label (eg.: "please add a complete reproduction")
2023-09-19 11:11:00 +00:00
Balázs Orbán
0f07cf5798
chore: verify missing/invalid/private reproduction links (#54724)
### What?

This PR adds a new action that verifies if the reproduction link is correct _after_ the issue has been created. If it is not, we close the issue and comment on it with the correct steps to take. Check out the [rendered comment here](https://github.com/balazsorban44/next.js/blob/chore/gh-invalid-link-checker/.github/actions/issue-validator/repro-link/invalid-link.md).

Additionally, this PR also does some refactoring to simplify our GitHub actions related to issues.

Tests:

Issue that was supposed to be closed:
 - https://github.com/balazsorban44/next.js/issues/48
   - Issue comment: https://github.com/balazsorban44/next.js/issues/48#issuecomment-1698836121 
   - Issue opened action: https://github.com/balazsorban44/next.js/actions/runs/6023209630
   - Issue labeled action: https://github.com/balazsorban44/next.js/actions/runs/6023209629

Issue that was not supposed to be closed (closed manually afterward):
 - https://github.com/balazsorban44/next.js/issues/49
   - Issue opened action: https://github.com/balazsorban44/next.js/actions/runs/6023214256
   - Issue labeled action: https://github.com/balazsorban44/next.js/actions/runs/6023214258


### Why?

Unfortunately, GitHub is currently missing the [functionality to require a valid reproduction link](https://github.com/orgs/community/discussions/10227) in issue templates. Even if that was supported, this PR adds functionality that could not be covered with a regex validation. Namely, we check if the reproduction is a private repo or not, and potentially could also check the structure to see if it's an actual Next.js project.

### How?

If the link is not in the expected section, not a GitHub, CodeSandbox, or Replay.io link, or does not return an OK response (eg.: private repo/sandbox), the issue is closed/commented.

Related:
- https://github.com/orgs/community/discussions/4629
- https://github.com/orgs/community/discussions/10227

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-30 17:40:57 +00:00
Balázs Orbán
3a86b30d68
chore: add GH action to notify about pending PRs (#53541)
Send us daily notifications when approved and open PRs haven't been merged yet. See [Slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1690610821861229) for more context.

It queries: https://github.com/search?q=repo%3Avercel%2Fnext.js%20is%3Apr%20is%3Aopen%20review%3Aapproved%20&type=pullrequests for the number of PRs, then posts a message with a link to https://github.com/vercel/next.js/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved
2023-08-03 21:40:28 +00:00
Balázs Orbán
df0330f72e
chore: add GitHub Action to manage "+1" comments (#52866)
### What?

Adds a GitHub Action that automatically marks unhelpful comments as "off-topic".

You can test it by adding off-topic comments to this issue: https://github.com/balazsorban44/next.js/issues/21

17e3ec3068/.github/actions/minus-one/src/index.mjs (L6)

### Why?

A common problem is when an issue thread receives "+1" comments, it usually encourages others to do the same. This makes the thread harder and harder for maintainers to read, without adding value to the discussion.

### How?

When an issue receives a comment, we compare it to a list that we determine as off-topic. If it matches, we hide the comment.

See: https://docs.github.com/en/graphql/reference/mutations#minimizecomment
2023-07-20 09:34:29 +00:00
Balázs Orbán
81dd7f8077
chore: add "please simplify reproduction" comment (#52631)
### What?

Adding a new label comment for "please simplify reproduction".

### Why?

During triaging, a lot of time is gone into trying to isolate the actual bug being reported. Reproductions sometimes contain unrelated code - that sometimes can be the actual cause of an issue, reported as a bug in Next.js, or require third-party services, secrets, setting up databases, and other tasks that take up much of the resources before the issue can even be verified.

### How?

Similar to the `please add a complete reproduction` and `please verify canary` labels, if a maintainer adds the `please simplify reproduction` label, an automatic comment will appear on the issue, asking for a minimal reproduction

[Slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1685527818400339)
2023-07-14 23:30:42 +00:00
Delba de Oliveira
20047fcdbd
Migrate validate links script from next-site and setup GitHub action (#51365)
This PR migrates and adapts the [validate docs links script from `next-site`](https://github.com/vercel/front/pull/23185). This script is triggered by a GitHub action whenever a file in the `/docs` folder is updated. If broken links are found in the docs, the check fails and we post a comment on the PR with a list of broken links.

Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-06-20 13:19:06 +00:00
Michael Novotny
55b29fb351
Updates prettier to latest version. (#51000)
There are some incoming docs / MDX changes where prettier will throw an error when using the older version. Updating prettier before I bring in those changes.

Looks like the most notable change is adding parentheses around `typeof` checks in TypeScript. 

**Before**

```
export type Locale = typeof i18n['locales'][number]
```

**After**

```
export type Locale = (typeof i18n)['locales'][number]
```
2023-06-09 14:58:19 +00:00
Tobias Koppers
3d40cb01ab
refactor webpack loaders (#49535)
### What?

* allow to apply existing pipeline
* change webpack loader key to glob for more flexibility
* add test cases
* add special error message when using the old config syntax

Old config:

```js
experimental: {
 turbo: {
  loaders: {
   ".mdx": ["mdx-loader"]
  }
 }
}
```

New config

``` js
experimental: {
 turbo: {
  rules: {
   // key is a glob now
   // normal syntax will treat the result as ecmascript code
   "*.mdx": ["mdx-loader"],
   // glob allows more advanced matching
   "./images/**/*.png": {
    loaders: ["image-optimize-loader"],
    // result of loader will be handled in other steps
    // under the same name/path (here .png)
    // This will use the existing .png pipeline (static asset)
    // It might also use other rules matching .png.
    as: "*"
   },
   "*.generate-image.js": {
    loaders: ["image-generation-loader"],
    // It also possible to pass this under a different name
    // into the pipeline. Here it will treat the result as png image
    as: "*.png"
   }
  }
 }
}
```

### Why?

More flexibility and allowing to use the builtin module handling over
non-js types.

fixes WEB-1009

### Turbopack changes

* https://github.com/vercel/turbo/pull/4955 <!-- OJ Kwon -
refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled*
-->
* https://github.com/vercel/turbo/pull/4880 <!-- Tobias Koppers -
refactor webpack loader execution -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-23 17:21:25 +02:00
Tobias Koppers
fe38369618
add test cases for error handling (#49093)
### What?

test cases for https://github.com/vercel/turbo/pull/4779
2023-05-02 22:09:55 +02:00
Leah
4354edadf4
fix snapshots broken by prettier (also fix .prettierignore) (#48586)
### What?
Fix snapshots that were no longer fulfilling the original purpose after
prettier had its way.

The `.prettierignore` also had the old `target/` directory (prior to the
`Cargo.toml` move in #48198) so running `pnpm prettier-fix` formatted
files in the `target/` directory
2023-04-21 18:52:08 +00:00
Leah
9b3bd73bb5
prettier fix for next-swc (#47873)
This enables the existing prettier config to auto apply to code inside
the `next-swc` package
2023-04-19 19:44:27 +02:00
Balázs Orbán
1a47872b64
chore: fix issue labeler (#47206)
### What?

A fork of https://github.com/github/issue-labeler that we pull in and
maintain.

### Why?

The official issue labeler had some issues which I tried to fix in PRs
and eventually got merged upstream, but the release cycle was a bit
slow, and that GitHub action had many parts we did not really need
anyway. So it makes sense to maintain it ourselves.

### How?

This PR removes the
https://github.com/vercel/next.js/blob/canary/.github/issue-labeler.yml
config file, which in our case is just a sublist of
https://github.com/vercel/next.js/labels anyway. Instead, we can pull in
the labels from GitHub directly and filter out those that we want to
apply to issues. This will keep things more in sync.

fix NEXT-750 ([link](https://linear.app/vercel/issue/NEXT-750))

---------
2023-03-20 17:55:56 -07:00
Tobias Koppers
3b91ca98a3
hmr error improvements (#30616)
Co-authored-by: Hannes Bornö <hannes.borno@vercel.com>
Co-authored-by: Hannes Bornö <borno.hannes@gmail.com>
2023-01-06 20:35:16 +01:00
Tim Neutkens
efcec4c1e3
Move core files to src folder and move JS files to TypeScript (#44405) 2023-01-03 10:05:50 +01:00
Balázs Orbán
5c8183464d
chore: check against npm version in issue validator (#38915)
I did some experimenting to see if we can grab the latest version from npm instead of GitHub releases since that's the version the user can actually use.

The npm registry sends the package metadata in a gigantic (~8mb for `next`) JSON response and parsing it with `res.json()` takes several seconds, but using `ReadableStream`, we only care about the first chunk. This way we can grab the relevant version information in a few ms. ~I added `undici` which implements `res.body.getReader()`.~ Using Node 18/native `fetch`.
2022-08-25 11:43:20 -05:00
Alex Cole
11bd44f031
Update Convex Example (#39562)
This makes a few changes to the Convex example app.
We're using this example app in the Convex quick start (https://docs.convex.dev/quick-start), so I want to make sure we're setting new users up for success.

Upgrade to the newest version of Convex (includes adding a tsconfig.json for Convex functions)
Switch to pinning Convex to latest
Check in generated code so the example will make more sense to users browsing on GitHub or before they regenerate the code. This required ignoring it in the global .prettierignore
Add prettier
Update styling so "Powered by Convex" appears on screen.
Switch the syntax of one function to make it type check after developers add a schema

Documentation / Examples

 Make sure the linting passes by running pnpm lint
 The examples guidelines are followed from our contributing doc

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-16 01:21:53 +01:00
Jessica Franco
97ab23fb6f
Add missing @napi-rs/cli devDependency to next-swc (#39164)
Otherwise build-native fails with "napi: command not found.".

Alternatively, this is missing from this package's devDependencies.



## Documentation / Examples

- [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)

P.S.: local copy fails `pnpm lint` due to the `target` subfolder with intermediate rust build artifacts... should I add a `.prettierignore` update to exclude `/packages/next-swc/target/`?

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-07-30 22:08:50 +00:00
JJ Kasper
f7b81316ae
Update to leverage pnpm for monorepo (#37259)
* Update to leverage pnpm for monorepo

* update compiled

* update stats action

* update ci install step

* update ci

* add test dep

* update invoking scripts

* update caching

* skip cache for now

* update dep

* update packages and fix babel

* update compiled

* update lint

* update test

* update ci

* update pnpm store caching

* update path for windows

* update restore-key config

* update caching

* remove extra build azure stage

* re-add checkout

* update setting pnpm store

* bump

* remove azure caching as pnpm is faster to download

* update contributing

* apply suggestions

* remove install-peers

* prepublish -> prepublishOnly

* prepublish -> prepublishOnly more

* more yarn -> pnpm references

* more yarn -> pnpm references take 2

* use workspace protocol for root package.json

Co-authored-by: Steven <steven@ceriously.com>
2022-05-28 23:35:16 -05:00
Tobias Koppers
ee220730db
fixes to allow lazy compilation for import() (#32441) 2021-12-14 11:33:04 +01:00
Maia Teegarden
a79d4fc366
Extract next-swc Rust code into its own package (#31635)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-11-21 12:59:56 +01:00
Maia Teegarden
b80c378975
Add/wasm build (#31470) 2021-11-17 20:01:02 +01:00
Tim Neutkens
a3bb6e78ca Exclude bench/nested-deps from prettier check 2021-10-10 13:20:16 +02:00
Tim Neutkens
325194ab5a Exclude SWC test input/output JS from prettier checks 2021-10-10 13:18:27 +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
Peter Mekhaeil
caaa1be5c6
chore: Set Prettier to ignore test output (#26353)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-20 14:37:44 -05:00
Guy Bedford
bddb02286f
feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
JJ Kasper
3cece4d2ad
Update Azure config (#18931) 2020-11-09 00:56:39 -05:00
JJ Kasper
ad22e77309
Expose dotenv loading under separate package (#17152)
* Expose dotenv loading under separate package

* Update pre-compiled

* Rename package to @next/env

* Update lint ignores

* Update package.json

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-09-25 13:14:28 -05:00
Tim Neutkens
62031ff24f
Move next-codemod to Next.js monorepo (#15536) 2020-08-10 11:14:53 +02:00
JJ Kasper
da5a05dc87
Migrate PR stats action into Next.js repo (#13177)
* Migrate PR stats into Next.js repo

* Update running prettier in local mode
2020-05-21 14:07:27 +02:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Simon Knott
be02fe183f
Allow @babel/preset-typescript to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured

Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.

This commit adds that functionality to `next/babel`.

* Add unit test for babel/preset allowing to pass options to @babel/preset-typescript

* Add integration test for onlyRemoveTypeImports

* Update babel dependencies

* Update to compatible typescript version and fix types

* Fix linting and run pre-nccing

* Update size-limit test

* Add additional tests

* Re-Apply delta to be calculated using -262

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-09 17:12:02 +02:00
Joe Haddad
93a94b8909
Do not prettify lerna.json 2020-05-03 21:56:17 -04:00
Joe Haddad
fbea795ad9
[Fast Refresh] Redesigned Runtime Error Experience (#12222) 2020-04-30 10:50:25 -04:00
Joe Haddad
450d4bd0f3
Experimental: React Refresh Support (#12008)
* Add Fast Refresh Support

* Add Basic Acceptance Test

* Increase delay

* fix version

* Ignore test files

* Update packages/next/build/webpack/loaders/next-babel-loader.js

* Copy tests

* Redo test style

* drop directory

* fix compile

* fix remove function

* Update helpers
2020-04-19 13:58:31 -04:00
Joe Haddad
ec3f8e5815
Create React Refresh Utils (#12006)
* Create React Refresh Utils

* Fix Linting

* Update Prettier Ignore

* fix rules
2020-04-18 13:55:10 -04:00
JJ Kasper
84b89c8b24
Pre-ncc compiled packages to prevent re-nccing unnecessarily (#11569)
* Pre-ncc compiled packages to prevent re-nccing unnecessarily

* Add compiled files

* Re-run pre-ncc step

* Add check to workflow to ensure pre-compiled doesnt need updating

* Update check-pre-compiled script

* Add handling for lower case license while nccing

* bump

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-04-07 09:42:16 -04:00
JJ Kasper
9943334d44
Update RegExp test and remove extra script (#11006)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-12 14:24:44 -04:00
Tim Neutkens
e52048daa7
Use core-js promise polyfill for nomodule browsers (#10985)
* Use core-js promise polyfill for nomodule browsers

Also updated to the core-js@3 features modules instead of importing the exact modules directly.

Fixes #10966

* Simplify reflect and regexp

* Add ie11 test for bad Promise

* Add test script for regexp and ie11

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-03-11 16:21:49 -04:00
Lukáš Huvar
3e81acee56 Improve prettier ignore (#8753) 2019-09-16 14:18:08 +02:00
Joe Haddad
b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00