Skip to content

Commit

Permalink
Merge branch 'canary' of github.com:vercel/next.js into docs-react-hy…
Browse files Browse the repository at this point in the history
…dration-ios
  • Loading branch information
timneutkens committed May 9, 2023
2 parents 087a063 + 81f5ed7 commit bf1d407
Show file tree
Hide file tree
Showing 11,090 changed files with 753,510 additions and 311,613 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .alexignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
CODE_OF_CONDUCT.md
examples/
**/*/LICENSE.md
4 changes: 3 additions & 1 deletion .alexrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"hooks",
"host-hostess",
"invalid",
"remains"
"remains",
"special",
"white"
]
}
33 changes: 33 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }

[build]

rustdocflags = []

[target.x86_64-pc-windows-msvc]
linker = "rust-lld"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = [
"--cfg",
"tokio_unstable",
"-Csymbol-mangling-version=v0",
"-Ctarget-feature=-crt-static",
"-Clink-arg=-lgcc",
]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.'cfg(all())']
rustflags = [
"--cfg",
"tokio_unstable",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
]
9 changes: 9 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[profile.default.overrides]]
filter = "package(next-dev-tests)"
# Default is 100ms. Extending this addresses false positives in the
# next-dev integration tests.
leak-timeout = "500ms"
retries = 2
slow-timeout = "60s"
threads-required = 2
failure-output = "immediate-final"
29 changes: 29 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=16-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# These are required to run playwright properly
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
gconf-service libxext6 libxfixes3 libxi6 libxrandr2 \
libxrender1 libcairo2 libcups2 libdbus-1-3 libexpat1 \
libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 \
libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 \
libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
libxdamage1 libxss1 libxtst6 libappindicator1 libnss3 libasound2 \
libatk1.0-0 libc6 libdrm-dev libgbm-dev ca-certificates fonts-liberation lsb-release xdg-utils wget \
# Chromium for running Turbopack benchmarks
chromium \
# Used for plotters graph visualizations in turbopack benchmarks
libfontconfig1-dev

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"

# Enable pnpm
RUN corepack enable pnpm
55 changes: 55 additions & 0 deletions .devcontainer/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=16-bullseye
FROM node:${VARIANT}

# [Option] Install zsh
ARG INSTALL_ZSH="true"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="true"

# Install needed packages, yarn, nvm and setup non-root user. Use a separate RUN statement to add your own dependencies.
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG NPM_GLOBAL=/usr/local/share/npm-global
ENV NVM_DIR=/usr/local/share/nvm
ENV NVM_SYMLINK_CURRENT=true \
PATH=${NPM_GLOBAL}/bin:${NVM_DIR}/current/bin:${PATH}
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
&& apt-get purge -y imagemagick imagemagick-6-common \
# Install common packages, non-root user, update yarn and install nvm
&& bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
# Install yarn, nvm
&& rm -rf /opt/yarn-* /usr/local/bin/yarn /usr/local/bin/yarnpkg \
&& bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "none" "${USERNAME}" \
# Configure global npm install location, use group to adapt to UID/GID changes
&& if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
&& usermod -a -G npm ${USERNAME} \
&& umask 0002 \
&& mkdir -p ${NPM_GLOBAL} \
&& touch /usr/local/etc/npmrc \
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
&& chmod g+s ${NPM_GLOBAL} \
&& npm config -g set prefix ${NPM_GLOBAL} \
&& sudo -u ${USERNAME} npm config -g set prefix ${NPM_GLOBAL} \
# Install eslint
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
&& npm cache clean --force > /dev/null 2>&1 \
# Install python-is-python3 on bullseye to prevent node-gyp regressions
&& . /etc/os-release \
&& if [ "${VERSION_CODENAME}" = "bullseye" ]; then apt-get -y install --no-install-recommends python-is-python3; fi \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /root/.gnupg /tmp/library-scripts

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>""
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/javascript-node
{
"name": "Next.js Dev Container",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": {
"VARIANT": "16-bullseye"
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["dbaeumer.vscode-eslint"]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
"features": {
// For some reason "git" or "rust" doesn't work
"ghcr.io/devcontainers/features/git:1": "os-provided",
"ghcr.io/devcontainers/features/rust:1": "latest"
// Github latest can't be installed due to GPG issues: https://github.com/cli/cli/discussions/6222
// "github-cli": "latest",
},
"remoteEnv": {
"DISPLAY": ":0"
}
}
13 changes: 10 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
**/.next/**
**/_next/**
**/.vscode/**
**/dist/**
e2e-tests/**
examples/with-eslint/**
Expand All @@ -11,13 +12,16 @@ examples/with-flow/**
examples/with-jest/**
examples/with-mobx-state-tree/**
examples/with-mobx/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/bundles/webpack/packages/lazy-compilation-*.js
packages/next/compiled/**/*
examples/with-tigris/db/models/todoItems.ts
packages/next/src/bundles/webpack/packages/*.runtime.js
packages/next/src/bundles/webpack/packages/lazy-compilation-*.js
packages/next/src/compiled/**/*
packages/react-refresh-utils/**/*.js
packages/react-dev-overlay/lib/**
**/__tmp__/**
.github/actions/next-stats-action/.work
.github/actions/issue-validator/index.mjs
.github/actions/issue-labeler/lib/index.js
packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
Expand All @@ -28,8 +32,11 @@ test/integration/eslint/**
test/integration/script-loader/**/*
test/development/basic/legacy-decorators/**/*
test/production/emit-decorator-metadata/**/*.js
test/e2e/app-dir/rsc-errors/app/swc/use-client/page.js
test-timings.json
packages/next-swc/crates/**
bench/nested-deps/pages/**
bench/nested-deps/components/**
packages/next-bundle-analyzer/index.d.ts
examples/with-typescript-graphql/lib/gql/
test/development/basic/hmr/components/parse-error.js
74 changes: 64 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"root": true,
"parser": "@babel/eslint-parser",
"plugins": ["react", "react-hooks", "jest", "import"],
"plugins": ["react", "react-hooks", "jest", "import", "jsdoc"],
"env": {
"browser": true,
"commonjs": true,
Expand Down Expand Up @@ -63,15 +63,16 @@
"@typescript-eslint/consistent-type-assertions": "warn",
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "warn",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-namespace": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"warn",
{
"functions": false,
"classes": false,
"variables": false,
"typedefs": false
"functions": true,
"classes": true,
"variables": true,
"enums": true,
"typedefs": true
}
],
"no-unused-vars": "off",
Expand All @@ -92,8 +93,19 @@
}
],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "warn"
}
"@typescript-eslint/no-useless-constructor": "warn",
"@typescript-eslint/prefer-literal-enum-member": "error",
"@typescript-eslint/prefer-namespace-keyword": "error"
},
"overrides": [
{
"files": ["packages/**"],
"rules": {
"jsdoc/no-types": "error",
"jsdoc/no-undefined-types": "error"
}
}
]
},
{
"files": [
Expand All @@ -106,6 +118,16 @@
{
"files": ["examples/**/*"],
"rules": {
"@typescript-eslint/no-use-before-define": [
"error",
{
"functions": true,
"classes": true,
"variables": true,
"enums": true,
"typedefs": true
}
],
"import/no-anonymous-default-export": [
"error",
{
Expand Down Expand Up @@ -136,6 +158,9 @@
{
"files": ["packages/**/*.tsx", "packages/**/*.ts"],
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["warn", { "builtinGlobals": false }],
"@typescript-eslint/no-unused-vars": [
"warn",
{
Expand All @@ -145,6 +170,30 @@
}
]
}
},
{
"files": [
"packages/eslint-plugin-next/**/*.js",
"test/unit/eslint-plugin-next/**/*.test.ts"
],
"extends": ["plugin:eslint-plugin/recommended"],
"parserOptions": {
"sourceType": "script"
},
"rules": {
"eslint-plugin/prefer-replace-text": "error",
"eslint-plugin/report-message-format": [
"error",
".+\\. See: https://nextjs.org/docs/messages/[a-z\\-]+$"
],
"eslint-plugin/require-meta-docs-description": [
"error",
{
"pattern": ".+"
}
],
"eslint-plugin/require-meta-docs-url": "error"
}
}
],
"rules": {
Expand Down Expand Up @@ -201,7 +250,6 @@
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-redeclare": ["warn", { "builtinGlobals": false }],
"no-regex-spaces": "warn",
"no-restricted-syntax": [
"warn",
Expand Down Expand Up @@ -291,6 +339,12 @@
"react/react-in-jsx-scope": "error",
"react/require-render-return": "error",
"react/style-prop-object": "warn",
"react-hooks/rules-of-hooks": "error"
"react-hooks/rules-of-hooks": "error",
// "@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/no-redeclare": [
"warn",
{ "builtinGlobals": false, "ignoreDeclarationMerge": true }
]
}
}
4 changes: 2 additions & 2 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ automerge_label = "ready to land"
require_automerge_label = false
method = "squash"
delete_branch_on_merge = true
optimistic_updates = true
optimistic_updates = false
prioritize_ready_to_merge = true
notify_on_conflict = false

Expand All @@ -16,4 +16,4 @@ body = "pull_request_body"
include_coauthors= true
include_pr_number = true
body_type = "markdown"
strip_html_comments = true
strip_html_comments = true

0 comments on commit bf1d407

Please sign in to comment.