Skip to content

Commit

Permalink
Merge branch 'canary' into fix-lint-crash-anonymous-export
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Dec 7, 2021
2 parents 5b21907 + 836334e commit 9db8a07
Show file tree
Hide file tree
Showing 71 changed files with 1,352 additions and 36 deletions.
106 changes: 105 additions & 1 deletion .github/workflows/build_test_deploy.yml
Expand Up @@ -715,6 +715,50 @@ jobs:
- run: cd packages/next-swc && cargo test
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}

test-wasm:
name: Test the wasm build
runs-on: ubuntu-18.04
needs: [build, build-native-dev, build-wasm-dev]

steps:
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}

- uses: actions/download-artifact@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
name: wasm-dev-binary
path: packages/next-swc/crates/wasm/pkg-nodejs

- run: ls packages/next-swc/crates/wasm

- uses: actions/download-artifact@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
name: next-swc-dev-binary
path: packages/next-swc/native

# node version needs to be 16+ to use --no-addons option
- name: Setup node
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions/setup-node@v2
with:
node-version: 16
check-latest: true

- run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: node ./scripts/setup-wasm.mjs
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: TEST_WASM=true xvfb-run node run-tests.js test/integration/production/test/index.test.js
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

# Build binaries for publishing
build-native:
needs: build
Expand Down Expand Up @@ -1255,4 +1299,64 @@ jobs:
name: wasm-binaries
path: packages/next-swc/crates/wasm/pkg-*

- run: ls packages/next-swc/crates/wasm
build-wasm-dev:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}

- name: Setup node
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install Rust
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-11-15
override: true
target: wasm32-unknown-unknown

- name: Cache
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions/cache@v2
with:
path: |
~/.cargo/
**/target/
key: ${{ runner.os }}-publish-integration

- name: Cache wasm binary
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: binary-cache
uses: actions/cache@v2
with:
path: packages/next-swc/crates/wasm/pkg-nodejs
key: dev-wasm-next-swc-nightly-2021-11-15-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}

- name: Install wasm-pack
if: ${{needs.build.outputs.docsChange != 'docs only change' && steps.binary-cache.outputs.cache-hit != 'true'}}
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build
if: ${{needs.build.outputs.docsChange != 'docs only change' && steps.binary-cache.outputs.cache-hit != 'true'}}
run: (wasm-pack build packages/next-swc/crates/wasm --dev --scope=next --target nodejs)

- name: Add target to folder name
if: ${{needs.build.outputs.docsChange != 'docs only change' && steps.binary-cache.outputs.cache-hit != 'true'}}
run: mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs

- name: Upload artifact
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions/upload-artifact@v2
with:
name: wasm-dev-binary
path: packages/next-swc/crates/wasm/pkg-nodejs
20 changes: 20 additions & 0 deletions .github/workflows/stale.yml
@@ -0,0 +1,20 @@
name: 'Stale issue handler'
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@main
id: stale
name: 'Close stale issues with no reproduction'
with:
only-labels: 'please add a complete reproduction'
close-issue-message: 'This issue has been automatically closed after 30 days of inactivity with no reproduction. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.'
days-before-issue-close: 30
days-before-pr-close: -1
days-before-pr-stale: -1
exempt-issue-labels: 'blocked,must,should,keep'
1 change: 1 addition & 0 deletions docs/advanced-features/preview-mode.md
Expand Up @@ -23,6 +23,7 @@ description: Next.js has the preview mode for statically generated pages. You ca
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-storyblok">Storyblok Example</a> (<a href="https://next-blog-storyblok.vercel.app/">Demo</a>)</li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-graphcms">GraphCMS Example</a> (<a href="https://next-blog-graphcms.vercel.app/">Demo</a>)</li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-kontent">Kontent Example</a> (<a href="https://next-blog-kontent.vercel.app//">Demo</a>)</li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-umbraco-heartcore">Umbraco Heartcore Example</a> (<a href="https://next-blog-umbraco-heartcore.vercel.app/">Demo</a>)</li>
</ul>
</details>

Expand Down
6 changes: 3 additions & 3 deletions errors/no-server-import-in-page.md
Expand Up @@ -2,13 +2,13 @@

### Why This Error Occurred

`next/server` was imported in a page outside of `pages/_middleware.js` (or `pages/_middleware.tsx` if you are using TypeScript)
`next/server` was imported outside of `pages/**/_middleware.{js,ts}`.

### Possible Ways to Fix It

Only import and use `next/server` within `pages/_middleware.js` (or `pages/_middleware.tsx`) to add middlewares.
Only import and use `next/server` in a file located within the pages directory: `pages/**/_middleware.{js,ts}`.

```jsx
```ts
// pages/_middleware.ts

import type { NextFetchEvent, NextRequest } from 'next/server'
Expand Down
1 change: 1 addition & 0 deletions examples/blog-starter/README.md
Expand Up @@ -37,6 +37,7 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)

## How to use

Expand Down
1 change: 1 addition & 0 deletions examples/cms-agilitycms/README.md
Expand Up @@ -30,6 +30,7 @@ Once you have access to [the environment variables you'll need](#step-15-set-up-
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-buttercms/README.md
Expand Up @@ -27,6 +27,7 @@ Once you have access to [the environment variables you'll need](#step-2-set-up-e
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-contentful/README.md
Expand Up @@ -27,6 +27,7 @@ Using the Deploy Button below, you'll deploy the Next.js project as well as conn
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-cosmic/README.md
Expand Up @@ -27,6 +27,7 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-datocms/README.md
Expand Up @@ -21,6 +21,7 @@ This example showcases Next.js's [Static Generation](https://nextjs.org/docs/bas
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## Deploy your own
Expand Down
1 change: 1 addition & 0 deletions examples/cms-ghost/README.md
Expand Up @@ -25,6 +25,7 @@ Once you have access to [the environment variables you'll need](#step-2-set-up-e
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-graphcms/README.md
Expand Up @@ -24,6 +24,7 @@ This example showcases Next.js's [Static Generation](https://nextjs.org/docs/bas
- [Storyblok](/examples/cms-storyblok)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## Deploy your own
Expand Down
1 change: 1 addition & 0 deletions examples/cms-kontent/README.md
Expand Up @@ -27,6 +27,7 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-prismic/README.md
Expand Up @@ -26,6 +26,7 @@ Once you have access to [the environment variables you'll need](#step-5-set-up-e
- [Storyblok](/examples/cms-storyblok)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-sanity/README.md
Expand Up @@ -27,6 +27,7 @@ Once you have access to [the environment variables you'll need](#step-4-set-up-e
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-storyblok/README.md
Expand Up @@ -27,6 +27,7 @@ Once you have access to [the environment variables you'll need](#step-6-set-up-e
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
1 change: 1 addition & 0 deletions examples/cms-strapi/README.md
Expand Up @@ -27,6 +27,7 @@ Once you have access to [the environment variables you'll need](#step-7-set-up-e
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)

## How to use
Expand Down
3 changes: 3 additions & 0 deletions examples/cms-umbraco-heartcore/.env.local.example
@@ -0,0 +1,3 @@
UMBRACO_PROJECT_ALIAS=
UMBRACO_API_KEY=
UMBRACO_PREVIEW_SECRET=
34 changes: 34 additions & 0 deletions examples/cms-umbraco-heartcore/.gitignore
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

0 comments on commit 9db8a07

Please sign in to comment.