Skip to content

Commit

Permalink
Merge branch 'canary' into decrease-time-spent-detecting-path-conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xadada authored Feb 18, 2023
2 parents c6ba5bc + 70c087e commit 1e086f9
Show file tree
Hide file tree
Showing 54 changed files with 653 additions and 196 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ jobs:

testFirefox:
name: Test Firefox (production)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
Expand All @@ -696,7 +696,7 @@ jobs:

testSafari:
name: Test Safari (production)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 15
env:
Expand Down Expand Up @@ -725,7 +725,7 @@ jobs:

testFirefoxNode18:
name: Test Firefox Node.js 18
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [build, testFirefox, build-native-test]
timeout-minutes: 10
env:
Expand Down Expand Up @@ -917,14 +917,14 @@ jobs:
# 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."
# So we get latest cache
- name: Cache built files
uses: actions/cache@v3
timeout-minutes: 5
with:
path: ./packages/next-swc/target
key: next-swc-cargo-cache-dev-ubuntu-latest-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
next-swc-cargo-cache-dev-ubuntu-latest
# - name: Cache built files
# uses: actions/cache@v3
# timeout-minutes: 5
# with:
# path: ./packages/next-swc/target
# key: next-swc-cargo-cache-dev-ubuntu-latest-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# next-swc-cargo-cache-dev-ubuntu-latest

- name: Build in docker
uses: addnab/docker-run-action@v3
Expand Down Expand Up @@ -983,7 +983,7 @@ jobs:

test-wasm:
name: Test the wasm build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [build, build-native-test, build-wasm-dev]

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ jobs:
# 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."
# So we get latest cache
- name: Cache built files
uses: actions/cache@v3
timeout-minutes: 5
with:
path: ./packages/next-target
key: next-swc-cargo-cache-ubuntu-latest--${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
next-swc-cargo-cache-ubuntu-latest
# - name: Cache built files
# uses: actions/cache@v3
# timeout-minutes: 5
# with:
# path: ./packages/next-target
# key: next-swc-cargo-cache-ubuntu-latest--${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# next-swc-cargo-cache-ubuntu-latest

- name: Build in docker
uses: addnab/docker-run-action@v3
Expand Down
4 changes: 2 additions & 2 deletions contributing/examples/adding-examples.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Adding examples

When you add an example to the [examples](examples) directory, please follow these guidelines to ensure high-quality examples:
When you add an example to the [examples](https://github.com/vercel/next.js/tree/canary/examples) directory, please follow these guidelines to ensure high-quality examples:

- TypeScript should be leveraged for new examples (no need for separate JavaScript and TypeScript examples, converting old JavaScript examples is preferred)
- Examples should not add custom ESLint configuration (we have specific templates for ESLint)
Expand All @@ -12,7 +12,7 @@ When you add an example to the [examples](examples) directory, please follow the
- Use `export default function` for page components and API Routes instead of `const`/`let` (The exception is if the page has `getInitialProps`, in which case [`NextPage`](https://nextjs.org/docs/api-reference/data-fetching/get-initial-props#typescript) could be useful)
- CMS example directories should be prefixed with `cms-`
- Example directories should not be prefixed with `with-`
- Make sure linting passes (you can run `pnpm lint-fix`)
- Make sure linting passes (you can run `pnpm build && pnpm lint` to verify and `pnpm lint-fix` for automatic fixes)

Also, don’t forget to add a `README.md` file with the following format:

Expand Down
2 changes: 1 addition & 1 deletion examples/with-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@testing-library/jest-dom": "^5.0.0",
"@testing-library/react": "^12.1.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^13.0.0",
"@types/jest": "^27.0.1",
"@types/node": "^16.9.1",
Expand Down
36 changes: 36 additions & 0 deletions examples/with-turbopack-loaders/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
48 changes: 48 additions & 0 deletions examples/with-turbopack-loaders/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Turbopack + Loaders

Turbopack supports a subset of webpack's loader API, allowing you to use some webpack loaders to transform code in Turbopack. This example shows you how to configure Next.js to use webpack loaders when running with `next --turbo`.

Install the dependencies and start the development server.

```sh
npm install
npm run dev
```

or

```sh
yarn
yarn dev
```

or

```sh
pnpm install
pnpm dev
```

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-turbopack-loaders)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-turbopack-loaders&project-name=with-turbopack-loaders&repository-name=with-turbopack-loaders)

## How to use

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:

```bash
npx create-next-app --example with-turbopack-loaders with-turbopack-loaders-app
```

```bash
yarn create next-app --example with-turbopack-loaders with-turbopack-loaders-app
```

```bash
pnpm create next-app --example with-turbopack-loaders with-turbopack-loaders-app
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
9 changes: 9 additions & 0 deletions examples/with-turbopack-loaders/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
experimental: {
turbo: {
loaders: {
'.svg': ['@svgr/webpack'],
},
},
},
}
20 changes: 20 additions & 0 deletions examples/with-turbopack-loaders/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"private": true,
"scripts": {
"dev": "next --turbo",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@svgr/webpack": "6.5.1",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"typescript": "^4.9.3"
}
}
5 changes: 5 additions & 0 deletions examples/with-turbopack-loaders/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Vercel from '../vercel.svg'

export default function Home() {
return <Vercel />
}
4 changes: 4 additions & 0 deletions examples/with-turbopack-loaders/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.1.7-canary.18"
"version": "13.1.7-canary.20"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.1.7-canary.18",
"version": "13.1.7-canary.20",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "13.1.7-canary.18",
"version": "13.1.7-canary.20",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -12,7 +12,7 @@
"test-pack": "cd ../../ && pnpm test-pack eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "13.1.7-canary.18",
"@next/eslint-plugin-next": "13.1.7-canary.20",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.42.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "13.1.7-canary.18",
"version": "13.1.7-canary.20",
"description": "ESLint plugin for NextJS.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "13.1.7-canary.18",
"version": "13.1.7-canary.20",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
Loading

0 comments on commit 1e086f9

Please sign in to comment.