No description
Find a file
Wyatt Johnson 56c324fb76
Simplified ensure promise handling (#55562)
In JS, Promise's are used to help manage async tasks and control flows. When code calls methods on a promise like `.then()`, `.catch()`, or `.finally()` the results of the promise are forwarded to the callback as soon as they're resolved. This serves to make a change to the promise creation such that we do not await on the promise until we're within the try/finally block. This will ensure that the promise will always be added to the map before it's resolved or rejected and it's cleanup (removing it from the active promises) is also completed.

This additionally introduces a new `scheduleOnNextTick` method and polyfill for `Promise.withResolvers()`.

`scheduleOnNextTick` is based on the scheduling algorithm used by https://github.com/graphql/dataloader which utilizes a `Promise.resolve()` combined with `process.nextTick` in order to schedule an operation to occur after the promises have resolved (see [graphql/dataloader](d336bd1528/src/index.js (L213-L255)))

The `Promise.withResolvers()` polyfill is an implementation of a soon-to-be-landed spec for inside-out promises. [Read the spec](https://tc39.es/proposal-promise-with-resolvers/)
2023-09-20 02:42:34 +00:00
.cargo Update rust toolchain (#54130) 2023-08-17 16:37:33 +00:00
.config Update Next.js code owners (#51319) 2023-06-14 20:07:32 -07:00
.devcontainer re-enable next-dev-tests (#47087) 2023-03-14 16:05:19 +01:00
.github Run unit tests in a single job run (#55625) 2023-09-20 01:09:26 +00:00
.husky Replace pre-commit with husky (#38350) 2022-07-06 11:14:16 -05:00
.vscode chore: upgrade to TypeScript 5.2.2 (#55105) 2023-09-07 18:46:05 +00:00
bench fix: upgrade listr2 from 5.0.5 to 5.0.8 (#55223) 2023-09-13 21:02:14 +00:00
contributing chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
docs docs: move optimizePackageImports to experimental (#55614) 2023-09-19 21:49:29 +00:00
errors chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
examples fix: examples/with-grafbase/package.json to reduce vulnerabilities (#55593) 2023-09-19 14:46:12 -04:00
packages Simplified ensure promise handling (#55562) 2023-09-20 02:42:34 +00:00
scripts improve publish-release (#55597) 2023-09-19 18:23:51 +02:00
test test(turbopack) migrate api tests, few image tests (#55552) 2023-09-19 20:14:53 +00:00
.alexignore Integrate next-* crates from Turbopack (#47019) 2023-03-13 14:33:17 +01:00
.alexrc docs: Add "special" to the Alex allowlist (#48021) 2023-04-06 16:32:06 +02:00
.eslintignore chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
.eslintrc.json server: re-land bundled runtimes (#55139) 2023-09-08 16:05:29 +00:00
.gitattributes chore: update gitattributes with linguist-vendored (#54683) 2023-08-28 21:50:19 +00:00
.gitignore Optimize webpack memory cache garbage collection (#54397) 2023-08-23 15:46:32 +02:00
.npmrc fix: npm publish provenance permissions (#48757) 2023-04-24 14:08:55 +00:00
.prettierignore chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
.prettierignore_staged chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
.prettierrc.json Prettier trailingComma default value to es5 since 2.0 (#14391) 2020-06-22 13:25:24 +02:00
.rustfmt.toml build(cargo): move workspaces manifest to top level (#48198) 2023-04-19 18:38:36 +02:00
azure-pipelines.yml fix: minimum node version 16.14.0 (#54331) 2023-08-22 08:58:53 +00:00
Cargo.lock test(turbopack) migrate api tests, few image tests (#55552) 2023-09-19 20:14:53 +00:00
Cargo.toml test(turbopack) migrate api tests, few image tests (#55552) 2023-09-19 20:14:53 +00:00
CODE_OF_CONDUCT.md updated code of conduct to v2.1 (#34208) 2022-02-10 18:11:42 -06:00
contributing.md chore: improve repo templates (#46629) 2023-03-01 09:25:51 -08:00
jest.config.js remove --turbo, use --experimental-turbo as --turbo (#55063) 2023-09-06 17:46:54 +00:00
jest.replay.config.js Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
lerna.json v13.5.1 2023-09-19 17:20:54 +00:00
license.md Update license year (#44403) 2023-01-01 11:12:49 +01:00
lint-staged.config.js Run dev tests against default CNA templates (#45211) 2023-01-24 11:01:03 -08:00
package.json Update React from d6dcad6a8 to 2807d781a (#55590) 2023-09-20 00:09:34 +00:00
plopfile.js Opt-in to dynamic rendering when reading searchParams (#46205) 2023-03-16 21:46:35 +01:00
pnpm-lock.yaml Update React from d6dcad6a8 to 2807d781a (#55590) 2023-09-20 00:09:34 +00:00
pnpm-workspace.yaml Optimize webpack memory cache garbage collection (#54397) 2023-08-23 15:46:32 +02:00
readme.md Monorepo (#5341) 2018-10-01 01:02:10 +02:00
release.js Fix labels for release sections 2021-11-21 13:11:54 +01:00
run-tests.js Run unit tests in a separate job (#55621) 2023-09-20 00:34:38 +00:00
rust-toolchain Update rust toolchain (#54130) 2023-08-17 16:37:33 +00:00
socket.yaml chore(ci): add socket.yaml (#54446) 2023-08-23 18:12:51 +00:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00
tsconfig-tsec.json Integrate tsec into the linting process (#33746) 2022-02-24 16:59:18 -08:00
tsconfig.json type check tests (and convert next-test-utils.js to ts) (#51071) 2023-06-23 17:42:50 +00:00
tsec-exemptions.json Move core files to src folder and move JS files to TypeScript (#44405) 2023-01-03 10:05:50 +01:00
turbo.json Implement granular rust caching (#54582) 2023-08-26 18:54:14 -07:00
UPGRADING.md (Fix)Broken upgrading.mdx link (#54234) 2023-08-18 17:10:38 +00:00
vercel.json Silence GH Comments for Preview URLs (#18766) 2020-11-03 21:59:47 +00:00

Next.js

Getting Started

Visit https://nextjs.org/learn to get started with Next.js.

Documentation

Visit https://nextjs.org/docs to view the full documentation.

Who is using Next.js?

Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.

Community

The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members you can join the Next.js Discord.

Our Code of Conduct applies to all Next.js community channels.

Contributing

Please see our contributing.md.

Good First Issues

We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Authors

Security

If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities.

https://vercel.com/security