Skip to content

Commit

Permalink
Merge branch 'experimental-node-streams-support' into implement-strea…
Browse files Browse the repository at this point in the history
…m-utils
  • Loading branch information
Ethan-Arrowood authored Jun 13, 2024
2 parents f74cfcb + de9f0e3 commit d2d71d0
Show file tree
Hide file tree
Showing 310 changed files with 5,011 additions and 2,840 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# [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
ARG VARIANT=20-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# [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
ARG VARIANT=20-bullseye
FROM node:${VARIANT}

# [Option] Install zsh
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": {
"VARIANT": "16-bullseye"
"VARIANT": "20-bullseye"
}
},
// Configure tool-specific properties.
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test-timings.json
packages/next-swc/crates/**
bench/nested-deps/**
bench/nested-deps-app-router/**
bench/heavy-npm-deps/**
packages/next-bundle-analyzer/index.d.ts
examples/with-typescript-graphql/lib/gql/
test/development/basic/hmr/components/parse-error.js
Expand Down
182 changes: 91 additions & 91 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
"error",
{
"args": "none",
"ignoreRestSiblings": true
Expand All @@ -102,7 +102,7 @@
"no-use-before-define": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-useless-constructor": "warn",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/prefer-literal-enum-member": "error"
}
},
Expand Down Expand Up @@ -150,7 +150,7 @@
"packages/next/webpack.config.js"
],
"rules": {
"no-shadow": ["warn", { "builtinGlobals": false }],
"no-shadow": ["error", { "builtinGlobals": false }],
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": false }
Expand All @@ -162,9 +162,9 @@
"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-shadow": ["error", { "builtinGlobals": false }],
"@typescript-eslint/no-unused-vars": [
"warn",
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
Expand Down Expand Up @@ -211,39 +211,39 @@
}
],
"rules": {
"array-callback-return": "warn",
"default-case": ["warn", { "commentPattern": "^no default$" }],
"dot-location": ["warn", "property"],
"eqeqeq": ["warn", "smart"],
"new-parens": "warn",
"no-array-constructor": "warn",
"no-caller": "warn",
"no-cond-assign": ["warn", "except-parens"],
"no-const-assign": "warn",
"no-control-regex": "warn",
"no-delete-var": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-empty-character-class": "warn",
"no-empty-pattern": "warn",
"no-eval": "warn",
"no-ex-assign": "warn",
"no-extend-native": "warn",
"no-extra-bind": "warn",
"no-extra-label": "warn",
"no-fallthrough": "warn",
"no-func-assign": "warn",
"no-implied-eval": "warn",
"no-invalid-regexp": "warn",
"no-iterator": "warn",
"no-label-var": "warn",
"no-labels": ["warn", { "allowLoop": true, "allowSwitch": false }],
"no-lone-blocks": "warn",
"no-loop-func": "warn",
"array-callback-return": "error",
"default-case": ["error", { "commentPattern": "^no default$" }],
"dot-location": ["error", "property"],
"eqeqeq": ["error", "smart"],
"new-parens": "error",
"no-array-constructor": "error",
"no-caller": "error",
"no-cond-assign": ["error", "except-parens"],
"no-const-assign": "error",
"no-control-regex": "error",
"no-delete-var": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-eval": "error",
"no-ex-assign": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-implied-eval": "error",
"no-invalid-regexp": "error",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": ["error", { "allowLoop": true, "allowSwitch": false }],
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-mixed-operators": [
"warn",
"error",
{
"groups": [
["&", "|", "^", "~", "<<", ">>", ">>>"],
Expand All @@ -254,37 +254,37 @@
"allowSamePrecedence": false
}
],
"no-multi-str": "warn",
"no-native-reassign": "warn",
"no-negated-in-lhs": "warn",
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-regex-spaces": "warn",
"no-multi-str": "error",
"no-native-reassign": "error",
"no-negated-in-lhs": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-symbol": "error",
"no-new-wrappers": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-regex-spaces": "error",
"no-restricted-syntax": [
"warn",
"error",
"WithStatement",
{
"message": "substr() is deprecated, use slice() or substring() instead",
"selector": "MemberExpression > Identifier[name='substr']"
}
],
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-shadow-restricted-names": "warn",
"no-sparse-arrays": "warn",
"no-script-url": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-this-before-super": "warn",
"no-throw-literal": "warn",
"no-this-before-super": "error",
"no-throw-literal": "error",
"no-undef": "error",
"no-unexpected-multiline": "warn",
"no-unreachable": "warn",
"no-unexpected-multiline": "error",
"no-unreachable": "error",
"no-unused-expressions": [
"error",
{
Expand All @@ -293,64 +293,64 @@
"allowTaggedTemplates": true
}
],
"no-unused-labels": "warn",
"no-unused-labels": "error",
"no-unused-vars": [
"warn",
"error",
{
"args": "none",
"ignoreRestSiblings": true
}
],
"no-use-before-define": "off",
"no-useless-computed-key": "warn",
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-escape": "warn",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-escape": "error",
"no-useless-rename": [
"warn",
"error",
{
"ignoreDestructuring": false,
"ignoreImport": false,
"ignoreExport": false
}
],
"no-with": "warn",
"no-whitespace-before-property": "warn",
"react-hooks/exhaustive-deps": "warn",
"require-yield": "warn",
"rest-spread-spacing": ["warn", "never"],
"strict": ["warn", "never"],
"unicode-bom": ["warn", "never"],
"use-isnan": "warn",
"valid-typeof": "warn",
"getter-return": "warn",
"react/forbid-foreign-prop-types": ["warn", { "allowInPropTypes": true }],
"react/jsx-no-comment-textnodes": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-target-blank": "warn",
"no-with": "error",
"no-whitespace-before-property": "error",
"react-hooks/exhaustive-deps": "error",
"require-yield": "error",
"rest-spread-spacing": ["error", "never"],
"strict": ["error", "never"],
"unicode-bom": ["error", "never"],
"use-isnan": "error",
"valid-typeof": "error",
"getter-return": "error",
"react/forbid-foreign-prop-types": ["error", { "allowInPropTypes": true }],
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-target-blank": "error",
"react/jsx-no-undef": "error",
"react/jsx-pascal-case": [
"warn",
"error",
{
"allowAllCaps": true,
"ignore": []
}
],
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/no-danger-with-children": "warn",
"react/no-deprecated": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-is-mounted": "warn",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/no-danger-with-children": "error",
"react/no-deprecated": "error",
"react/no-direct-mutation-state": "error",
"react/no-is-mounted": "error",
"react/no-typos": "error",
"react/react-in-jsx-scope": "off",
"react/require-render-return": "error",
"react/style-prop-object": "warn",
"react/style-prop-object": "error",
"react-hooks/rules-of-hooks": "error",
// "@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/prefer-as-const": "warn",
// "@typescript-eslint/non-nullable-type-assertion-style": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/no-redeclare": [
"warn",
"error",
{ "builtinGlobals": false, "ignoreDeclarationMerge": true }
]
}
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
NAPI_CLI_VERSION: 2.16.2
TURBO_VERSION: 1.13.3-canary.2
TURBO_VERSION: 2.0.3
NODE_LTS_VERSION: 20
CARGO_PROFILE_RELEASE_LTO: 'true'
TURBO_TEAM: 'vercel'
Expand Down Expand Up @@ -84,9 +84,11 @@ jobs:
- 'arm64'

target: 'x86_64-apple-darwin'
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && corepack enable
turbo run build-native-release -vvv --remote-cache-timeout 90 --summarize -- --target x86_64-apple-darwin
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target x86_64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node
- host:
Expand All @@ -95,35 +97,41 @@ jobs:
- 'arm64'

target: 'aarch64-apple-darwin'
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
build: |
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && corepack enable
turbo run build-native-release -vvv --remote-cache-timeout 90 --summarize -- --target aarch64-apple-darwin
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node
- host:
- 'self-hosted'
- 'windows'
- 'x64'

# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
build: |
corepack enable
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}"
turbo run build-native-release -vvv --remote-cache-timeout 90 --summarize -- --target x86_64-pc-windows-msvc
turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target x86_64-pc-windows-msvc
target: 'x86_64-pc-windows-msvc'

- host:
- 'self-hosted'
- 'windows'
- 'x64'

# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
build: |
corepack enable
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}"
turbo run build-native-no-plugin-release -vvv --remote-cache-timeout 90 --summarize -- --target i686-pc-windows-msvc
turbo run build-native-no-plugin-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target i686-pc-windows-msvc
target: 'i686-pc-windows-msvc'

- host:
Expand All @@ -132,10 +140,12 @@ jobs:
- 'x64'

target: 'aarch64-pc-windows-msvc'
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
build: |
corepack enable
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}"
turbo run build-native-no-plugin-release -vvv --remote-cache-timeout 90 --summarize -- --target aarch64-pc-windows-msvc
turbo run build-native-no-plugin-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target aarch64-pc-windows-msvc
- host:
- 'self-hosted'
Expand Down Expand Up @@ -279,7 +289,7 @@ jobs:
# issues with turbo caching
- name: pull build cache
if: ${{ matrix.settings.docker }}
run: node ./scripts/pull-turbo-cache.js ${{ matrix.settings.target }}
run: npm i -g turbo@${{ env.TURBO_VERSION }} && node ./scripts/pull-turbo-cache.js ${{ matrix.settings.target }}

- name: check build exists
if: ${{ matrix.settings.docker }}
Expand Down Expand Up @@ -374,7 +384,9 @@ jobs:
run: node scripts/normalize-version-bump.js

- name: Build
run: turbo run build-wasm -vvv --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }}
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
run: turbo run build-wasm -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }}

- name: Add target to folder name
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-${{ matrix.target }} || ls packages/next-swc/crates/wasm'
Expand Down
Loading

0 comments on commit d2d71d0

Please sign in to comment.