-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into chore/remove-fromentries-polyfill
- Loading branch information
Showing
10 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/integration/react-rsc-basic/app/components/red/index.client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import styles from './style.module.css' | ||
|
||
export default function RedText({ children }) { | ||
return <div className={styles.text}>{children}</div> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/react-rsc-basic/app/components/red/style.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.text { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import '../styles.css' | ||
|
||
function App({ Component, pageProps }) { | ||
return <Component {...pageProps} /> | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
test/integration/react-rsc-basic/app/pages/css-modules.server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// CSS modules can only be imported inside client components for now. | ||
import RedText from '../components/red/index.client' | ||
|
||
export default function CSSM() { | ||
return ( | ||
<RedText> | ||
<h1>This should be in red</h1> | ||
</RedText> | ||
) | ||
} |
7 changes: 7 additions & 0 deletions
7
test/integration/react-rsc-basic/app/pages/global-styles-rsc.server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function GlobalStyle() { | ||
return ( | ||
<div> | ||
<h1 id="red">This should be in red</h1> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function GlobalStyle() { | ||
return ( | ||
<div> | ||
<h1 id="red">This should be in red</h1> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#red { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-env jest */ | ||
import webdriver from 'next-webdriver' | ||
|
||
export default function (context) { | ||
it('should include global styles under `concurrentFeatures: true`', async () => { | ||
const browser = await webdriver(context.appPort, '/global-styles') | ||
const currentColor = await browser.eval( | ||
`window.getComputedStyle(document.querySelector('#red')).color` | ||
) | ||
expect(currentColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`) | ||
}) | ||
it('should include global styles with `serverComponents: true`', async () => { | ||
const browser = await webdriver(context.appPort, '/global-styles-rsc') | ||
const currentColor = await browser.eval( | ||
`window.getComputedStyle(document.querySelector('#red')).color` | ||
) | ||
expect(currentColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`) | ||
}) | ||
// TODO: fix this test | ||
// it.skip('should include css modules with `serverComponents: true`', async () => { | ||
// const browser = await webdriver(context.appPort, '/css-modules') | ||
// const currentColor = await browser.eval( | ||
// `window.getComputedStyle(document.querySelector('h1')).color` | ||
// ) | ||
// expect(currentColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`) | ||
// }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters