-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
partially fix css duplication in app dir (#61198)
### What? depends on facebook/react#28108 * fixes CSS Ordering issues due to CSS duplication in production mode * The issues still happen in dev mode * Highlights broken CSS Ordering for more dev cases, e. g. CSS in client components Closes PACK-2300
- Loading branch information
Showing
20 changed files
with
475 additions
and
60 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
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 @@ | ||
$base1: rgb(255, 1, 0); | ||
|
||
.base { | ||
color: $base1; | ||
} |
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 @@ | ||
.base { | ||
color: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.base { | ||
color: rgb(255, 3, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.base { | ||
color: rgb(255, 2, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use client' | ||
|
||
import Link from 'next/link' | ||
import baseStyle from '../base2.module.css' | ||
import baseStyle2 from '../base2-scss.module.scss' | ||
import style from './style.module.css' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p | ||
className={`${style.name} ${baseStyle.base} ${baseStyle2.base}`} | ||
id="hello1c" | ||
> | ||
hello world | ||
</p> | ||
<Link href={'/first'} id="first"> | ||
First | ||
</Link> | ||
<Link href={'/first-client'} id="first-client"> | ||
First client | ||
</Link> | ||
<Link href={'/second'} id="second"> | ||
Second | ||
</Link> | ||
<Link href={'/second-client'} id="second-client"> | ||
Second client | ||
</Link> | ||
<Link href={'/third'} id="third"> | ||
Third | ||
</Link> | ||
</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,4 @@ | ||
.name { | ||
composes: base from '../base.module.css'; | ||
color: rgb(255, 0, 255); | ||
} |
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,32 @@ | ||
import Link from 'next/link' | ||
import baseStyle from '../base2.module.css' | ||
import baseStyle2 from '../base2-scss.module.scss' | ||
import style from './style.module.css' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p | ||
className={`${style.name} ${baseStyle.base} ${baseStyle2.base}`} | ||
id="hello1" | ||
> | ||
hello world | ||
</p> | ||
<Link href={'/first'} id="first"> | ||
First | ||
</Link> | ||
<Link href={'/first-client'} id="first-client"> | ||
First client | ||
</Link> | ||
<Link href={'/second'} id="second"> | ||
Second | ||
</Link> | ||
<Link href={'/second-client'} id="second-client"> | ||
Second client | ||
</Link> | ||
<Link href={'/third'} id="third"> | ||
Third | ||
</Link> | ||
</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,4 @@ | ||
.name { | ||
composes: base from '../base.module.css'; | ||
color: blue; | ||
} |
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 Root({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
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,11 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p>hello world</p> | ||
<Link href={'/first'}>First</Link> | ||
<Link href={'/second'}>Second</Link> | ||
</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,34 @@ | ||
'use client' | ||
|
||
import Link from 'next/link' | ||
import baseStyle from '../base2.module.css' | ||
import baseStyle2 from '../base2-scss.module.scss' | ||
import style from './style.module.css' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p | ||
className={`${style.name} ${baseStyle.base} ${baseStyle2.base}`} | ||
id="hello2c" | ||
> | ||
hello world | ||
</p> | ||
<Link href={'/first'} id="first"> | ||
First | ||
</Link> | ||
<Link href={'/first-client'} id="first-client"> | ||
First client | ||
</Link> | ||
<Link href={'/second'} id="second"> | ||
Second | ||
</Link> | ||
<Link href={'/second-client'} id="second-client"> | ||
Second client | ||
</Link> | ||
<Link href={'/third'} id="third"> | ||
Third | ||
</Link> | ||
</div> | ||
) | ||
} |
4 changes: 4 additions & 0 deletions
4
test/e2e/app-dir/css-order/app/second-client/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,4 @@ | ||
.name { | ||
composes: base from '../base.module.css'; | ||
color: rgb(255, 128, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Link from 'next/link' | ||
import baseStyle from '../base2.module.css' | ||
import baseStyle2 from '../base2-scss.module.scss' | ||
import style from './style.module.scss' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p | ||
className={`${style.name} ${baseStyle.base} ${baseStyle2.base}`} | ||
id="hello2" | ||
> | ||
hello world | ||
</p> | ||
<Link href={'/first'} id="first"> | ||
First | ||
</Link> | ||
<Link href={'/first-client'} id="first-client"> | ||
First client | ||
</Link> | ||
<Link href={'/second'} id="second"> | ||
Second | ||
</Link> | ||
<Link href={'/second-client'} id="second-client"> | ||
Second client | ||
</Link> | ||
<Link href={'/third'} id="third"> | ||
Third | ||
</Link> | ||
</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,4 @@ | ||
.name { | ||
composes: base from '../base-scss.module.scss'; | ||
color: green; | ||
} |
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,32 @@ | ||
import Link from 'next/link' | ||
import baseStyle from '../base2.module.css' | ||
import baseStyle2 from '../base2-scss.module.scss' | ||
import style from './style.module.scss' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p | ||
className={`${style.name} ${baseStyle.base} ${baseStyle2.base}`} | ||
id="hello3" | ||
> | ||
hello world | ||
</p> | ||
<Link href={'/first'} id="first"> | ||
First | ||
</Link> | ||
<Link href={'/first-client'} id="first-client"> | ||
First client | ||
</Link> | ||
<Link href={'/second'} id="second"> | ||
Second | ||
</Link> | ||
<Link href={'/second-client'} id="second-client"> | ||
Second client | ||
</Link> | ||
<Link href={'/third'} id="third"> | ||
Third | ||
</Link> | ||
</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,4 @@ | ||
.name { | ||
composes: base from '../base-scss.module.scss'; | ||
color: rgb(0, 128, 128); | ||
} |
Oops, something went wrong.