Skip to content

fix: support appDir #1638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 209 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
8efc635
chore: update canary demo
ascorbic Sep 23, 2022
c4500c4
chore: add app-dir demo
ascorbic Sep 23, 2022
2c85686
fix: resolve page deps in app dir
ascorbic Sep 23, 2022
d07f4a2
fix: patch duplicate declaration
ascorbic Sep 23, 2022
335ee34
fix: resolve nft deps
ascorbic Sep 23, 2022
cceb348
feat: add support for appdir edge runtime
ascorbic Sep 26, 2022
7607049
chore: update next canary and react (and change APIs)
ascorbic Sep 27, 2022
2321816
fix: update patch syntax
ascorbic Sep 27, 2022
1492d06
fix: include file itself in deps
ascorbic Sep 27, 2022
38e118c
chore: upgrade next and remove workaround
ascorbic Sep 28, 2022
9852eb2
chore: move app-dir site to canary
ascorbic Sep 28, 2022
f5a2979
Merge branch 'main' into mk/canary-demo
ascorbic Sep 28, 2022
57fb3a6
chore: update snapshot
ascorbic Sep 28, 2022
47a07da
chore: add initial app-dir tests
ascorbic Sep 28, 2022
b7d25bc
chore: use correct site for canary tests
ascorbic Sep 29, 2022
8cc835a
Merge branch 'main' into mk/canary-demo
ascorbic Sep 29, 2022
1e70c21
chore: enable plugin
ascorbic Sep 29, 2022
9ccaaf2
ci: use vitest for canary e2e tests
ascorbic Sep 29, 2022
190e71a
Merge branch 'main' into mk/canary-demo
ascorbic Sep 29, 2022
b91f352
chore: re-enable plugin
ascorbic Sep 29, 2022
21520ad
chore: setup playwright
ascorbic Sep 29, 2022
6d40de0
chore: wait longer when first using playwright
ascorbic Sep 29, 2022
3d69f4e
chore: run tests headless
ascorbic Sep 29, 2022
9e6b12e
chore: install chromium
ascorbic Sep 29, 2022
2977900
chore: longer timeout
ascorbic Sep 29, 2022
572de53
chore: use undici
ascorbic Sep 29, 2022
f6d1c48
chore: enable remaining tests
ascorbic Sep 29, 2022
b6d7017
chore: fix test syntax
ascorbic Sep 30, 2022
c34b4fb
chore: update demos
ascorbic Sep 30, 2022
3ff8ecc
chore: update canary
ascorbic Sep 30, 2022
9ff1d95
chore: fix 404 test
ascorbic Sep 30, 2022
8397658
chore: disable test that depends on an upstream fix
ascorbic Sep 30, 2022
2410ed7
chore: fix handling of "self" object
ascorbic Oct 1, 2022
c35db55
chore: update packages
ascorbic Oct 1, 2022
622e7eb
chore: update canary
ascorbic Oct 3, 2022
8cb5cc5
chore: tidy and add license for next.js code
ascorbic Oct 3, 2022
a4c4f84
Merge branch 'main' into mk/canary-demo
ascorbic Oct 3, 2022
5c270d8
chore: handle empty static manifest
ascorbic Oct 3, 2022
eb785ed
Merge branch 'main' into mk/canary-demo
ascorbic Oct 3, 2022
ca325de
chore: downgrasde canary because of regression
ascorbic Oct 3, 2022
30cd451
chore: logging for windows
ascorbic Oct 4, 2022
25edbe9
Merge branch 'main' into mk/canary-demo
ascorbic Oct 4, 2022
69f6ff3
Merge branch 'main' into mk/canary-demo
ascorbic Oct 4, 2022
82b5999
Merge branch 'main' into mk/canary-demo
ascorbic Oct 5, 2022
ee962b8
Apply suggestions from code review
ascorbic Oct 5, 2022
17bb6d4
Merge branch 'main' into mk/canary-demo
ascorbic Oct 5, 2022
ee77473
chore: update next canary
ascorbic Oct 6, 2022
40480f4
chore: remove npmrc
ascorbic Oct 7, 2022
bff65d7
Merge branch 'main' into mk/canary-demo
ascorbic Oct 7, 2022
d9db615
chore: update next and react
ascorbic Oct 7, 2022
410a405
chore: update test site
ascorbic Oct 7, 2022
6449114
chore: update tests
ascorbic Oct 7, 2022
f69140d
chore: add back npmrc
ascorbic Oct 7, 2022
3fe1311
fix: use globby not tiny-glob
ascorbic Oct 7, 2022
f646397
chore: update fixtures
ascorbic Oct 7, 2022
886917e
Merge branch 'main' into mk/canary-demo
ascorbic Oct 17, 2022
dd14229
chore: deps
ascorbic Oct 17, 2022
bcb5bcb
Merge branch 'main' into mk/canary-demo
ascorbic Oct 19, 2022
31347b5
chore: update tests and demo
ascorbic Oct 19, 2022
bbc8252
fix: correct request types
ascorbic Oct 22, 2022
a0c6d06
fix: skip generating lambda for edge api routes
ascorbic Oct 22, 2022
0de0f1a
Merge branch 'main' into mk/canary-demo
ascorbic Oct 22, 2022
0d248c1
chore: log request
ascorbic Oct 22, 2022
dbb94f9
chore: add runtime as dep
ascorbic Oct 22, 2022
21a2983
chore: pre-version
ascorbic Oct 22, 2022
54e32bb
chore: add canary to ws
ascorbic Oct 22, 2022
770f77d
chore: fix build
ascorbic Oct 22, 2022
415af7c
chore: fix monorepo setup
ascorbic Oct 22, 2022
8a367e9
chore: upgrade
ascorbic Oct 22, 2022
883e7a8
chore: react no-longer pre-bundled
ascorbic Oct 22, 2022
cf5b8e8
chore: remove deliberately broken demo pages
ascorbic Oct 23, 2022
2f88697
fix: move pre-rendered appdir files
ascorbic Oct 23, 2022
294ff05
fix: correct manifest path
ascorbic Oct 23, 2022
0ecebea
chore: update demo
ascorbic Oct 24, 2022
e9d7d27
Merge branch 'main' into mk/canary-demo
ascorbic Oct 24, 2022
72ba0c5
chore: update tests
ascorbic Oct 24, 2022
f7041aa
chore: add sass test
ascorbic Oct 24, 2022
64a02b9
chore: update demo config
ascorbic Oct 24, 2022
5b978bd
chore: skip test that also fails upstream
ascorbic Oct 24, 2022
9cf9146
Merge branch 'main' into mk/canary-demo
ascorbic Oct 24, 2022
631db3b
chore: update next canary
ascorbic Oct 24, 2022
8810d43
chore: update use usage
ascorbic Oct 24, 2022
628d52b
Merge branch 'main' into mk/canary-demo
ascorbic Oct 25, 2022
04e1399
chore: update canary
ascorbic Oct 25, 2022
3fbd229
fix: support loading static files for both pages and app
ascorbic Oct 25, 2022
03693b5
chore: update canary
ascorbic Oct 25, 2022
34f0948
chore: update canary
ascorbic Oct 25, 2022
755446d
chore: final canary!
ascorbic Oct 25, 2022
9a43a09
chore(deps): update demos and deps to Next 13
ascorbic Oct 25, 2022
cfa5a46
chore: add swc
ascorbic Oct 25, 2022
aab3b80
chore: switch old node tests to use node 14
ascorbic Oct 25, 2022
c310c57
fix: correct requestdata type
ascorbic Oct 25, 2022
c02aed0
chore: update next/link syntax
ascorbic Oct 25, 2022
04b536c
chore: use legacy image component for now
ascorbic Oct 25, 2022
bc10b8b
Merge branch 'mk/next-13' into mk/canary-demo
ascorbic Oct 25, 2022
af56ac5
Merge branch 'main' into mk/canary-demo
ascorbic Oct 26, 2022
74e80e0
chore: update demo
ascorbic Oct 26, 2022
8e0c91b
Merge branch 'main' into mk/canary-demo
ascorbic Oct 27, 2022
c277033
Merge branch 'main' into mk/canary-demo
ascorbic Oct 27, 2022
383fb95
Merge branch 'main' into mk/canary-demo
ascorbic Nov 9, 2022
716bfdd
Merge branch 'main' into mk/canary-demo
ascorbic Nov 11, 2022
ccf97f9
chore: update canary demo
ascorbic Nov 11, 2022
688d109
Merge branch 'main' into mk/canary-demo
ascorbic Nov 14, 2022
2e4d2a0
chore: all the tests
ascorbic Nov 16, 2022
1fada0c
chore: fix eslint
ascorbic Nov 16, 2022
119acea
chore: parallelise e2e tests
ascorbic Nov 16, 2022
56af7cd
chore: don't fail fast
ascorbic Nov 16, 2022
1b585b3
chore: unignore modules and use node-fetch
ascorbic Nov 16, 2022
6e21fb4
chore: very parallel
ascorbic Nov 16, 2022
8208c99
chore: don't mock fetch :facepalm:
ascorbic Nov 17, 2022
5a8e8e0
chore: remove disabled tests
ascorbic Nov 17, 2022
244feb9
chore: test with node 18
ascorbic Nov 17, 2022
b001fa2
chore: switchable fetch
ascorbic Nov 17, 2022
54c6dbd
chore: remove irrelevant tests
ascorbic Nov 17, 2022
a9bb106
chore: remove disabled test
ascorbic Nov 17, 2022
94922e4
chore: add reporter
ascorbic Nov 17, 2022
a83ec22
chore: no concurrency
ascorbic Nov 17, 2022
6da9677
chore: try to fix jest
ascorbic Nov 17, 2022
cd387b7
chore: fix test command
ascorbic Nov 17, 2022
a5d802f
chore: artifact file path
ascorbic Nov 17, 2022
40f82a0
chore: use site build command
ascorbic Nov 17, 2022
5deb9e4
chore: download artifacts
ascorbic Nov 17, 2022
1aefa22
chore: report per-chunk
ascorbic Nov 18, 2022
a1fb9fe
chore: update syntax
ascorbic Nov 18, 2022
1bad311
chore: report to summary
ascorbic Nov 18, 2022
1e8b82a
chore: do annotate
ascorbic Nov 18, 2022
8e738ac
chore: update and add summary
ascorbic Nov 18, 2022
04d85ba
chore: rearrange
ascorbic Nov 18, 2022
e59241d
chore: combine tests
ascorbic Nov 18, 2022
ea61bb9
chore: fix test
ascorbic Nov 18, 2022
5fd01b6
chore: rearrange and disable failing suites
ascorbic Nov 18, 2022
00f105f
chore: skip broken ntl and fail faster
ascorbic Nov 18, 2022
d0aaab4
chore: disable suite
ascorbic Nov 18, 2022
155bca9
chore: skip failing tests
ascorbic Nov 21, 2022
703443a
chore: add ability to run disabled tests
ascorbic Nov 21, 2022
8d82ad5
chore: add comments to workflow file
ascorbic Nov 21, 2022
b387a42
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 21, 2022
59f8aa2
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 22, 2022
5d0a5f3
chore: one worker per file
ascorbic Nov 22, 2022
d8f55d9
Merge branch 'mk/all-the-tests' of github.com:netlify/next-runtime in…
ascorbic Nov 22, 2022
8daf9a7
chore: oops
ascorbic Nov 22, 2022
585f940
chore: make path relative to test dir
ascorbic Nov 22, 2022
8d4e75e
chore: conditionally skip
ascorbic Nov 22, 2022
f0044fe
chore: enable middleware-responses test
ascorbic Nov 22, 2022
5c5a847
chore: run all tests once
ascorbic Nov 22, 2022
e4de44c
chore: don't run disabled tests
ascorbic Nov 22, 2022
f6a9699
fix: ensure responses are Responses
ascorbic Nov 22, 2022
3de3b89
chore: re-enable test
ascorbic Nov 22, 2022
7f0634f
chore: run all tests
ascorbic Nov 22, 2022
10d46de
chore: enable another suite
ascorbic Nov 22, 2022
5bf495e
fix: better headers.getAll polyfill
ascorbic Nov 22, 2022
cf52991
chore: enable middleware-redirects suite
ascorbic Nov 22, 2022
55141ed
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 22, 2022
62070b8
chore: conditionally enable req body tests
ascorbic Nov 22, 2022
bacd775
chore: disable failing tests
ascorbic Nov 22, 2022
f070c64
chore: add test readme doc
ascorbic Nov 23, 2022
4065399
chore: remove eslint changes
ascorbic Nov 23, 2022
63b7eb4
Merge branch 'mk/all-the-tests' into mk/canary-demo
ascorbic Nov 23, 2022
0f5482b
chore: add new appdir tests
ascorbic Nov 23, 2022
aa0a762
chore: use canary for appdir tests
ascorbic Nov 23, 2022
c34ce6a
chore: use extended matchers
ascorbic Nov 23, 2022
e22ccce
chore: increase timeout
ascorbic Nov 23, 2022
a4a91f8
chore: enable tests that were disabled upstream
ascorbic Nov 24, 2022
72a5c54
chore: don't clobber package.json in tests
ascorbic Nov 24, 2022
9001fbb
chore: set EdgeRuntime name globally
ascorbic Nov 24, 2022
d7ce259
chore: remove logs
ascorbic Nov 24, 2022
684d5d2
chore: update tests
ascorbic Nov 24, 2022
8990c5f
chore: test updates
ascorbic Nov 24, 2022
db56a5a
Merge branch 'main' into mk/canary-demo
ascorbic Nov 24, 2022
82fea50
chore: increase timeout
ascorbic Nov 24, 2022
25914f1
chore: increase timeout for site deploy
ascorbic Nov 24, 2022
1b4d92d
chore: include step annotations
ascorbic Nov 24, 2022
cc1eb1b
chore: don't use canary demo for this
ascorbic Nov 24, 2022
ceba306
chore: increase timeout
ascorbic Nov 24, 2022
c7681d0
chore: add rewrite-to-edge demo
ascorbic Nov 24, 2022
b120d69
chore: deploy edge functions after cache
ascorbic Nov 24, 2022
9c447dd
chore: refresh lockfile
ascorbic Nov 24, 2022
42720de
chore: enable rewrite tests
ascorbic Nov 24, 2022
ed3557e
chore: update tests
ascorbic Nov 24, 2022
d5088b0
chore: update tests
ascorbic Nov 24, 2022
41c1858
chore: enable rsc tests
ascorbic Nov 25, 2022
d2c6a7c
chore: skip tests
ascorbic Nov 25, 2022
6289524
chore: re-enable dev check
ascorbic Nov 25, 2022
83ea1a4
Merge branch 'main' into mk/canary-demo
ascorbic Nov 28, 2022
5331918
chore: update lockfile
ascorbic Nov 28, 2022
62a6049
Merge branch 'main' into mk/canary-demo
ascorbic Nov 29, 2022
8b8eadb
chore: run workflows only on new pr and pr sync
ascorbic Nov 29, 2022
cd9f1eb
chore: add log about testing appdir
ascorbic Nov 29, 2022
8341be8
chore: only use cache: manual if site uses appDir
ascorbic Nov 29, 2022
e7ba4aa
chore: changes from review
ascorbic Nov 29, 2022
96be7c7
Merge branch 'main' into mk/canary-demo
ascorbic Dec 2, 2022
26a7298
Merge branch 'main' into mk/canary-demo
ascorbic Dec 5, 2022
43d5c8f
ci: fix e2e test
ascorbic Dec 5, 2022
25bd981
fix: correctly match static files against rewrites
ascorbic Dec 5, 2022
d525dfc
Merge branch 'main' into mk/canary-demo
ascorbic Dec 8, 2022
e4db114
chore: upgrade next
ascorbic Dec 8, 2022
5ca66a4
Merge branch 'main' into mk/canary-demo
ascorbic Dec 8, 2022
1e4c31c
chore: increase timeout
ascorbic Dec 8, 2022
13d3c73
chore: extend timeout
ascorbic Dec 8, 2022
1c3cc3e
fix: handle prefetch correctly
ascorbic Dec 8, 2022
ba3cc95
chore: rmeove log
ascorbic Dec 9, 2022
54d9a91
chore: log env
ascorbic Dec 9, 2022
4d78687
chore: enough with these rules
ascorbic Dec 9, 2022
5a3aae7
chore: fix base url
ascorbic Dec 9, 2022
1234cfd
chore: try with all tests
ascorbic Dec 9, 2022
4e89a33
chore: don't run disabled tests
ascorbic Dec 9, 2022
f7c91cb
Merge branch 'main' into mk/canary-demo
ascorbic Dec 9, 2022
b972d3d
Merge branch 'main' into mk/canary-demo
ascorbic Dec 12, 2022
7abc8b8
fix: vary on prefetch
ascorbic Dec 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ on:
branches:
- main
paths:
- 'demos/canary/**/*.{js,jsx,ts,tsx}'
- 'cypress/integration/canary/**/*.{ts,js}'
- 'test/e2e/canary/**/*.{js,jsx,ts,tsx}'
- 'demos/canary/**/*'
- 'src/**/*.{ts,js}'
jobs:
cypress:
name: Cypress
vitest:
name: Vitest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -35,39 +31,31 @@ jobs:
token: ${{ steps.get-token.outputs.token }}
path: ./.github/actions/wait-for-netlify-deploy

- name: Node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'

- name: Install npm dependencies
run: npm install

- name: Install Playwright dependencies
run: npm run playwright:install

- name: Wait for Netlify Deploy
id: deploy
uses: ./.github/actions/wait-for-netlify-deploy
with:
site-name: netlify-plugin-nextjs-demo
site-name: next-plugin-canary
timeout: 300

- name: Deploy successful
if: ${{ steps.deploy.outputs.origin-url }}
run: echo ${{ steps.deploy.outputs.origin-url }}

- name: Node
uses: actions/setup-node@v2
with:
node-version: '16'

- run: npm install

- name: Cypress run
- name: Run e2e tests
if: ${{ steps.deploy.outputs.origin-url }}
id: cypress
uses: cypress-io/github-action@v2
with:
browser: chrome
headless: true
record: true
parallel: true
config-file: cypress/config/canary.json
group: 'Next Runtime - Demo Canary'
spec: cypress/integration/canary/*
run: npm run test:e2e
env:
DEBUG: '@cypress/github-action'
CYPRESS_baseUrl: ${{ steps.deploy.outputs.origin-url }}
CYPRESS_NETLIFY_CONTEXT: ${{ steps.deploy.outputs.context }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CANARY_CYPRESS_RECORD_KEY }}
SITE_URL: ${{ steps.deploy.outputs.origin-url }}
5 changes: 0 additions & 5 deletions cypress/config/canary.json

This file was deleted.

15 changes: 0 additions & 15 deletions cypress/integration/canary/images.spec.ts

This file was deleted.

3 changes: 0 additions & 3 deletions demos/canary/.eslintrc.json

This file was deleted.

35 changes: 0 additions & 35 deletions demos/canary/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions demos/canary/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there errors or warnings being raised as a result of this not being set within the project? Or is this being introduced for another reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I added that when there were errors building, but it looks like it doesn't need it anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

30 changes: 2 additions & 28 deletions demos/canary/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
Based on [Next.js app dir e2e tests](https://github.com/vercel/next.js/blob/canary/test/e2e/app-dir/app).
[License](https://github.com/vercel/next.js/blob/canary/license.md).
7 changes: 7 additions & 0 deletions demos/canary/app/(newroot)/dashboard/another/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function AnotherPage(props) {
return (
<>
<p>hello from newroot/dashboard/another</p>
</>
)
}
19 changes: 19 additions & 0 deletions demos/canary/app/(newroot)/dashboard/project/[projectId]/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { experimental_use as use } from 'react'

function getData({ params }) {
return {
now: Date.now(),
params,
}
}

export default function Page(props) {
const data = use(getData(props))

return (
<>
<p>/dashboard/project/[projectId]</p>
<p id="props">{JSON.stringify(data)}</p>
</>
)
}
20 changes: 20 additions & 0 deletions demos/canary/app/(newroot)/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { experimental_use as use } from 'react'

async function getData() {
return {
world: 'world',
}
}

export default function Root({ children }) {
const { world } = use(getData())

return (
<html className="this-is-another-document-html">
<head>
<title>{`hello ${world}`}</title>
</head>
<body className="this-is-another-document-body">{children}</body>
</html>
)
}
7 changes: 7 additions & 0 deletions demos/canary/app/(rootonly)/dashboard/changelog/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function ChangelogPage(props) {
return (
<>
<p>hello from app/dashboard/changelog</p>
</>
)
}
7 changes: 7 additions & 0 deletions demos/canary/app/(rootonly)/dashboard/hello/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function HelloPage(props) {
return (
<>
<p>hello from app/dashboard/rootonly/hello</p>
</>
)
}
2 changes: 2 additions & 0 deletions demos/canary/app/catch-all/[...slug]/components/widget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// components under catch-all should not throw errors
export default () => <p id="widget">widget</p>
12 changes: 12 additions & 0 deletions demos/canary/app/catch-all/[...slug]/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Widget from './components/widget'

export default function Page({ params }) {
return (
<>
<h1 id="text" data-params={params.slug.join('/') ?? ''}>
hello from /catch-all/{params.slug.join('/')}
</h1>
<Widget />
</>
)
}
20 changes: 20 additions & 0 deletions demos/canary/app/client-component-route/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'client'

import { useState, useEffect } from 'react'

import style from './style.module.css'
import './style.css'

export default function ClientComponentRoute() {
const [count, setCount] = useState(0)
useEffect(() => {
setCount(1)
}, [count])
return (
<>
<p className={style.red}>
hello from app/client-component-route. <b>count: {count}</b>
</p>
</>
)
}
3 changes: 3 additions & 0 deletions demos/canary/app/client-component-route/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
b {
color: blue;
}
3 changes: 3 additions & 0 deletions demos/canary/app/client-component-route/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.red {
color: red;
}
20 changes: 20 additions & 0 deletions demos/canary/app/client-nested/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'client'

import { useState, useEffect } from 'react'

import styles from './style.module.css'
import './style.css'

export default function ClientNestedLayout({ children }) {
const [count, setCount] = useState(0)
useEffect(() => {
setCount(1)
}, [])
return (
<>
<h1 className={styles.red}>Client Nested. Count: {count}</h1>
<button onClick={() => setCount(count + 1)}>{count}</button>
{children}
</>
)
}
7 changes: 7 additions & 0 deletions demos/canary/app/client-nested/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function ClientPage() {
return (
<>
<p>hello from app/client-nested</p>
</>
)
}
3 changes: 3 additions & 0 deletions demos/canary/app/client-nested/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
button {
color: red;
}
3 changes: 3 additions & 0 deletions demos/canary/app/client-nested/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.red {
color: red;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'client'

// export function getServerSideProps() { { props: {} } }

export default function Page() {
return 'client-gssp'
}
7 changes: 7 additions & 0 deletions demos/canary/app/client-with-errors/get-static-props/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'client'

// export function getStaticProps() { return { props: {} }}

export default function Page() {
return 'client-gsp'
}
3 changes: 3 additions & 0 deletions demos/canary/app/css/css-client/client-foo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.foo {
color: blue;
}
3 changes: 3 additions & 0 deletions demos/canary/app/css/css-client/client-layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background: cyan;
}
6 changes: 6 additions & 0 deletions demos/canary/app/css/css-client/client-page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
h1 {
color: red !important;
}
h1::after {
content: ' (from css-client!!!!)';
}
5 changes: 5 additions & 0 deletions demos/canary/app/css/css-client/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import './client-foo.css'

export default function Foo() {
return <b className="foo">foo</b>
}
14 changes: 14 additions & 0 deletions demos/canary/app/css/css-client/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'client'

import './client-layout.css'

import Foo from './foo'

export default function ServerLayout({ children }) {
return (
<>
{children}
<Foo />
</>
)
}
7 changes: 7 additions & 0 deletions demos/canary/app/css/css-client/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'client'

import './client-page.css'

export default function Page() {
return <h1>Page!!!</h1>
}
14 changes: 14 additions & 0 deletions demos/canary/app/css/css-nested/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'client'

import './style.css'
import styles from './style.module.css'

export default function ClientLayout({ children }) {
return (
<>
<div className={styles['client-css']}>Client Layout: CSS Modules</div>
<div className="client-css">Client Layout: Global CSS</div>
{children}
</>
)
}
Loading