Skip to content

appdir #88

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
25 changes: 0 additions & 25 deletions README.md

This file was deleted.

7 changes: 7 additions & 0 deletions 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 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 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 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 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 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 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 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 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 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 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 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 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 app/client-nested/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.red {
color: red;
}
7 changes: 7 additions & 0 deletions app/client-with-errors/get-server-side-props/page.js
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 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 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 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 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 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 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 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 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}
</>
)
}
5 changes: 5 additions & 0 deletions app/css/css-nested/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'client'

export default function Page() {
return null
}
3 changes: 3 additions & 0 deletions app/css/css-nested/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.client-css {
color: green;
}
3 changes: 3 additions & 0 deletions app/css/css-nested/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.client-css {
color: green;
}
5 changes: 5 additions & 0 deletions app/css/css-page/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import './style2.css'

export default function ServerLayout({ children }) {
return <>{children}</>
}
13 changes: 13 additions & 0 deletions app/css/css-page/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import './style.css'
import styles from './style.module.css'

export default function Page() {
return (
<>
<h1>Page</h1>
<div id="cssm" className={styles.mod}>
CSSM
</div>
</>
)
}
3 changes: 3 additions & 0 deletions app/css/css-page/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h1 {
color: red;
}
3 changes: 3 additions & 0 deletions app/css/css-page/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mod {
color: blue;
}
3 changes: 3 additions & 0 deletions app/css/css-page/style2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background: #ccc;
}
1 change: 1 addition & 0 deletions app/css/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './style.module.css'
15 changes: 15 additions & 0 deletions app/css/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import './style.css'
import './css-page/style.css'
import styles from './style.module.css'

export default function ServerLayout({ children }) {
return (
<>
<div id="server-cssm" className={styles['server-css'] || 'undefined'}>
Server Layout: CSS Modules
</div>
<div className="server-css">Server Layout: Global CSS</div>
{children}
</>
)
}
3 changes: 3 additions & 0 deletions app/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.server-css {
color: blue;
}
3 changes: 3 additions & 0 deletions app/css/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.server-css {
color: green;
}
7 changes: 7 additions & 0 deletions app/dashboard/(custom)/deployments/breakdown/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function DeploymentsBreakdownPage(props) {
return (
<>
<p>hello from app/dashboard/(custom)/deployments/breakdown</p>
</>
)
}
8 changes: 8 additions & 0 deletions app/dashboard/(custom)/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function CustomDashboardRootLayout({ children }) {
return (
<>
<h2>Custom dashboard</h2>
{children}
</>
)
}
18 changes: 18 additions & 0 deletions app/dashboard/client-comp-client.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'client'

import styles from './client-comp.module.css'

import { useEffect, useState } from 'react'

export default function ClientComp() {
const [state, setState] = useState({})
useEffect(() => {
setState({ test: 'HELLOOOO' })
}, [])
return (
<>
<p className={styles.client}>Hello</p>
{state.test}
</>
)
}
3 changes: 3 additions & 0 deletions app/dashboard/client-comp.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.client {
color: #2e5aea;
}
17 changes: 17 additions & 0 deletions app/dashboard/deployments/[id]/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { experimental_use as use } from 'react'

async function getData({ params }) {
return {
id: params.id,
}
}

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

return (
<>
<p>hello from app/dashboard/deployments/[id]. ID is: {data.id}</p>
</>
)
}
7 changes: 7 additions & 0 deletions app/dashboard/deployments/info/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function DeploymentsInfoPage(props) {
return (
<>
<p>hello from app/dashboard/deployments/info</p>
</>
)
}
Loading