-
Notifications
You must be signed in to change notification settings - Fork 7
test: test tailwind-v4 vite plugin #677
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
hi-ogawa
wants to merge
14
commits into
main
Choose a base branch
from
test-tailwind-v4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e334d35
test: test tailwind-v4 vite plugin
hi-ogawa b575439
wip
hi-ogawa d1f8547
fix: fix tailwind version
hi-ogawa fbb6b82
chore: use insiders
hi-ogawa 911b9c5
fix: rename `virtual:dev-ssr-css`
hi-ogawa 5d67393
chore: cleanup
hi-ogawa d610bba
chore: lockfile
hi-ogawa e6b84fa
chore: cleanup
hi-ogawa dcbd384
Merge branch 'main' into test-tailwind-v4
hi-ogawa 56856f0
fix: magic word `/.vite/` to workaround dead lock?
hi-ogawa 2f7dc3f
chore: lockfile
hi-ogawa c45139f
chore: typo
hi-ogawa b7a72ba
chore: deps
hi-ogawa 835a688
wip: patch isPotentialCssRootFile
hi-ogawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| tailwind v4 |
11 changes: 11 additions & 0 deletions
11
packages/react-server/examples/tailwind-v4/app/_action.tsx
This file contains hidden or 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 @@ | ||
| "use server"; | ||
|
|
||
| let count = 0; | ||
|
|
||
| export async function changeCount() { | ||
| count++; | ||
| } | ||
|
|
||
| export function getCount() { | ||
| return count; | ||
| } |
This file contains hidden or 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,9 @@ | ||
| "use client"; | ||
|
|
||
| import React from "react"; | ||
|
|
||
| export function TestClient() { | ||
| const [count, setCount] = React.useState(0); | ||
|
|
||
| return <button onClick={() => setCount(count + 1)}>Client: {count}</button>; | ||
| } |
This file contains hidden or 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,13 @@ | ||
| import type React from "react"; | ||
| import "./styles.css"; | ||
|
|
||
| export default function Layout(props: React.PropsWithChildren) { | ||
| return ( | ||
| <html> | ||
| <body> | ||
| <div>[Layout]</div> | ||
| {props.children} | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
This file contains hidden or 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,14 @@ | ||
| import { changeCount, getCount } from "./_action"; | ||
| import { TestClient } from "./_client"; | ||
|
|
||
| export default function Page() { | ||
| return ( | ||
| <> | ||
| <div>[Page]</div> | ||
| <TestClient /> | ||
| <form action={changeCount}> | ||
| <button>Action: {getCount()}</button> | ||
| </form> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or 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 @@ | ||
| @import "tailwindcss"; |
This file contains hidden or 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,25 @@ | ||
| { | ||
| "name": "@hiogawa/react-server-example-tailwind-v4", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "next dev", | ||
| "build": "next build", | ||
| "start": "next start" | ||
| }, | ||
| "dependencies": { | ||
| "@hiogawa/react-server": "workspace:*", | ||
| "next": "link:../../../react-server-next", | ||
| "react": "rc", | ||
| "react-dom": "rc", | ||
| "react-server-dom-webpack": "rc" | ||
| }, | ||
| "devDependencies": { | ||
| "@tailwindcss/vite": "0.0.0-insiders.d684733", | ||
| "@types/react": "latest", | ||
| "@types/react-dom": "latest", | ||
| "tailwindcss": "0.0.0-insiders.d684733", | ||
| "vite": "latest" | ||
| } | ||
| } |
This file contains hidden or 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,17 @@ | ||
| { | ||
| "include": ["**/*.ts", "**/*.tsx"], | ||
| "compilerOptions": { | ||
| "strict": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "skipLibCheck": true, | ||
| "verbatimModuleSyntax": true, | ||
| "noEmit": true, | ||
| "moduleResolution": "Bundler", | ||
| "module": "ESNext", | ||
| "target": "ESNext", | ||
| "lib": ["ESNext", "DOM"], | ||
| "types": ["next"], | ||
| "jsx": "react-jsx" | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| import tailwindcss from "@tailwindcss/vite"; | ||
| import next from "next/vite"; | ||
| import { defineConfig } from "vite"; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [next(), tailwindcss()], | ||
| }); |
This file contains hidden or 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,2 +1,4 @@ | ||
| export const SERVER_CSS_PROXY = "virtual:server-css-proxy.js"; | ||
| export const DEV_SSR_CSS = "virtual:dev-ssr-css.css"; | ||
| // avoid .css prefix to exclude the virtual from tailwind v4's waitForRequestsIdle | ||
| // https://github.com/tailwindlabs/tailwindcss/blob/d684733d804a0b8951d13c94fe27350271e076b6/packages/%40tailwindcss-vite/src/index.ts#L313-L322 | ||
| export const DEV_SSR_CSS = "virtual:dev-ssr-css"; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.