Skip to content

Commit

Permalink
Merge branch 'canary' into app-pages-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Bornö committed Nov 16, 2022
2 parents 8335797 + 3fe9b4c commit 2909359
Show file tree
Hide file tree
Showing 87 changed files with 1,744 additions and 625 deletions.
110 changes: 71 additions & 39 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -1030,6 +1030,10 @@ jobs:
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-
- name: normalize versions
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
run: node scripts/normalize-version-bump.js

# We use restore-key to pick latest cache.
# We will not get exact match, but doc says
# "If there are multiple partial matches for a restore key, the action returns the most recently created cache."
Expand Down Expand Up @@ -1153,17 +1157,17 @@ jobs:
target: 'x86_64-apple-darwin'
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release
turbo run build-native -- --release --target x86_64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native --cache-dir=".turbo" -- --release
turbo run build-native -- --release --target x86_64-pc-windows-msvc
target: 'x86_64-pc-windows-msvc'
- host: windows-latest
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target i686-pc-windows-msvc
turbo run build-native-no-plugin -- --release --target i686-pc-windows-msvc
target: 'i686-pc-windows-msvc'
- host: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
Expand All @@ -1175,7 +1179,7 @@ jobs:
rustup target add x86_64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
unset CC_x86_64_unknown_linux_gnu && unset CC &&
turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-gnu &&
turbo run build-native -- --release --target x86_64-unknown-linux-gnu &&
strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'x86_64-unknown-linux-musl'
Expand All @@ -1187,7 +1191,7 @@ jobs:
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-musl &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl &&
turbo run build-native -- --release --target x86_64-unknown-linux-musl &&
strip packages/next-swc/native/next-swc.*.node
- host: macos-latest
target: 'aarch64-apple-darwin'
Expand All @@ -1198,7 +1202,7 @@ jobs:
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}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-apple-darwin
turbo run build-native -- --release --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'aarch64-unknown-linux-gnu'
Expand All @@ -1211,7 +1215,7 @@ jobs:
rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc &&
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu &&
turbo run build-native -- --release --target aarch64-unknown-linux-gnu &&
llvm-strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'armv7-unknown-linux-gnueabihf'
Expand All @@ -1220,7 +1224,7 @@ jobs:
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf
turbo run build-native-no-plugin -- --release --target armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: aarch64-linux-android
Expand All @@ -1235,7 +1239,7 @@ jobs:
chmod 777 "${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/${CLANG_VERSION}/lib/linux/aarch64/libgcc.a"
echo "INPUT(-lunwind)" > "${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/${CLANG_VERSION}/lib/linux/aarch64/libgcc.a"
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android
turbo run build-native -- --release --target aarch64-linux-android
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: armv7-linux-androideabi
Expand All @@ -1250,7 +1254,7 @@ jobs:
chmod 777 "${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/${CLANG_VERSION}/lib/linux/arm/libgcc.a"
echo "INPUT(-lunwind)" > "${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/${CLANG_VERSION}/lib/linux/arm/libgcc.a"
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target armv7-linux-androideabi
turbo run build-native-no-plugin -- --release --target armv7-linux-androideabi
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'aarch64-unknown-linux-musl'
Expand All @@ -1263,17 +1267,21 @@ jobs:
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-musl &&
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-musl &&
turbo run build-native -- --release --target aarch64-unknown-linux-musl &&
llvm-strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest
target: 'aarch64-pc-windows-msvc'
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features
turbo run build-native-no-plugin -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: build
name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}
env:
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: 'true'
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
Expand Down Expand Up @@ -1302,16 +1310,6 @@ jobs:
key: next-swc-cargo-cache-${{ matrix.settings.target }}--${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
next-swc-cargo-cache-${{ matrix.settings.target }}
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ matrix.settings.target }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-${{ matrix.settings.target }}
turbo-${{ github.job }}-${{ github.ref_name }}-${{ matrix.settings.target }}-${{ needs.build.outputs.weekNum }}-
turbo-${{ github.job }}-canary-${{ matrix.settings.target }}-${{ needs.build.outputs.weekNum }}-
- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -1341,6 +1339,9 @@ jobs:
path: ~/.cargo/git
key: ${{ matrix.settings.target }}-cargo-index

- name: normalize versions
run: node scripts/normalize-version-bump.js

- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
Expand All @@ -1351,7 +1352,7 @@ jobs:
if: ${{ matrix.settings.docker }}
with:
image: ${{ matrix.settings.docker }}
options: -e RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} -e NAPI_CLI_VERSION=${{ env.NAPI_CLI_VERSION }} -e TURBO_VERSION=${{ env.TURBO_VERSION }} -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
options: -e RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} -e NAPI_CLI_VERSION=${{ env.NAPI_CLI_VERSION }} -e TURBO_VERSION=${{ env.TURBO_VERSION }} -e TURBO_TEAM=vercel -e TURBO_TOKEN=${{ secrets.TURBO_TOKEN }} -e TURBO_REMOTE_ONLY=true -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
run: ${{ matrix.settings.build }}

- name: 'Build'
Expand All @@ -1370,21 +1371,48 @@ jobs:
needs: build
name: stable - x86_64-unknown-freebsd - node@16
runs-on: macos-12
env:
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: 'true'
steps:
- name: tune mac network
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true

- run: npm i -g turbo@${{ env.TURBO_VERSION }} pnpm@${PNPM_VERSION}

- name: Delete useless files
run: |
rm -rf bench
rm -rf docs
rm -rf errors
rm -rf examples
rm -rf scripts
rm -rf test
- run: node scripts/normalize-version-bump.js

# attempt pulling existing turbo cache, this must be done
# outside of the freeBSD vm as there isn't a turbo build
# for freeBSD currently
- run: node ./scripts/pull-freebsd-cache.js

- name: check build exists
run: if [ -f packages/next-swc/native/next-swc.freebsd-x64.node ]; then echo "::set-output name=BUILD_EXISTS::yes"; else echo "::set-output name=BUILD_EXISTS::no"; fi
id: build-exists

- run: echo ${{steps.build-exists.outputs.BUILD_EXISTS}}

- name: Build
id: build
uses: vmactions/freebsd-vm@v0.3.0
uses: vmactions/freebsd-vm@v0
if: ${{ steps.build-exists.outputs.BUILD_EXISTS == 'no' }}
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
Expand All @@ -1393,7 +1421,7 @@ jobs:
# Disable LTO, or the lld may crash with OOM
CARGO_PROFILE_RELEASE_LTO: false
with:
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS CARGO_PROFILE_RELEASE_LTO NAPI_CLI_VERSION TURBO_VERSION RUST_TOOLCHAIN PNPM_VERSION
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS CARGO_PROFILE_RELEASE_LTO NAPI_CLI_VERSION RUST_TOOLCHAIN PNPM_VERSION
usesh: true
mem: 6000
prepare: |
Expand All @@ -1417,6 +1445,11 @@ jobs:
pnpm --filter=@next/swc run build-native-no-plugin --platform --release --target x86_64-unknown-freebsd
rm -rf node_modules
rm -rf packages/next-swc/target
- name: cache build
if: ${{ steps.build-exists.outputs.BUILD_EXISTS == 'no' }}
run: pnpm turbo run cache-build-native -- --platform --release --target x86_64-unknown-freebsd

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -1431,6 +1464,10 @@ jobs:
matrix:
target: [web, nodejs]
runs-on: macos-latest
env:
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: 'true'
steps:
- uses: actions/cache@v3
id: restore-build
Expand All @@ -1454,22 +1491,14 @@ jobs:

- run: npm i -g turbo@${{ env.TURBO_VERSION }} pnpm@${PNPM_VERSION}

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ matrix.target }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ matrix.target }}-
turbo-${{ github.job }}-${{ matrix.target }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
turbo-${{ github.job }}-${{ matrix.target }}-canary-${{ needs.build.outputs.weekNum }}-
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: normalize versions
run: node scripts/normalize-version-bump.js

- name: Build
run: turbo run build-wasm --cache-dir=".turbo" -- --target ${{ matrix.target }}
run: turbo run build-wasm -- --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 Expand Up @@ -1513,7 +1542,6 @@ jobs:
id: turbo-cache
uses: actions/cache@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}

with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
Expand All @@ -1526,6 +1554,10 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: normalize versions
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: node scripts/normalize-version-bump.js

- name: Build
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: turbo run build-wasm --cache-dir=".turbo" -- --target nodejs --dev
Expand Down
4 changes: 2 additions & 2 deletions docs/basic-features/layouts.md
Expand Up @@ -58,9 +58,9 @@ import Layout from '../components/layout'
import NestedLayout from '../components/nested-layout'

export default function Page() {
return {
return (
/** Your content */
}
)
}

Page.getLayout = function getLayout(page) {
Expand Down
4 changes: 0 additions & 4 deletions examples/with-atlaskit/.babelrc

This file was deleted.

21 changes: 0 additions & 21 deletions examples/with-atlaskit/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions examples/with-atlaskit/components/ButtonComponent.js

This file was deleted.

30 changes: 0 additions & 30 deletions examples/with-atlaskit/components/CheckboxComponent.js

This file was deleted.

0 comments on commit 2909359

Please sign in to comment.