Skip to content

Commit 463d680

Browse files
authored
Remove react-native-web-tailwind-compat (#3)
Once uni-stack/uniwind#281 is fixed , `react-native-web-tailwind-compat` will no longer be required and can be removed
1 parent 40fc8d6 commit 463d680

20 files changed

Lines changed: 143 additions & 946 deletions

File tree

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
name: Run Tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '24'
23+
24+
- uses: pnpm/action-setup@v4
25+
name: Install pnpm
26+
with:
27+
run_install: true
28+
29+
- name: Run tests
30+
run: pnpm test

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# uniwind-plugin-next
22

3-
[Uniwind](https://uniwind.dev/) config plugin for Next.js projects using Webpack. Turbopack is not supported at this stage.
3+
[Uniwind](https://uniwind.dev/) config plugin for Next.js projects using Webpack. Turbopack-based projects are not supported at this stage.
44

55
## Example
66
See a fully working example project here: [Demo](http://uniwind-next.a16n.dev/) ([Source](https://github.com/a16n-dev/uniwind-plugin-next/tree/main/examples/next-16))
77

8-
98
## Compatibility
109
See the table below for tested versions of `uniwind-plugin-next` and corresponding versions of `uniwind`. Other versions of `uniwind` may work, but are not guaranteed to.
1110

1211
Tested on Next `16.1`, but other versions will likely work fine.
1312

1413
| Uniwind | uniwind-plugin-next |
1514
|-------------------|---------------------|
16-
| `1.2.2`-`1.2.3` | `1.1.0`-`1.2.0` |
15+
| `1.2.7` | `1.4.0` |
1716
| `1.2.4` - `1.2.6` | `1.3.0` |
17+
| `1.2.2`-`1.2.3` | `1.2.0` |
1818

1919
## Installation & setup
2020
This setup guide assumes you already have a next.js project setup with Tailwind v4
@@ -91,6 +91,4 @@ export default withUniwindPro(withExpo(nextConfig), { ... });
9191
## SSR Considerations
9292
- This plugin marks all Uniwind web components with `'use client'` automatically, so you do not need to do this manually.
9393

94-
- Be aware that some Uniwind features, such as `withUniwind` and `useResolveClassNames` will not work in a server environment, as they rely on accessing `window` or `document`.
95-
96-
- Additional code is required to avoid a flash of unstyled content (FOUC). See the example project for reference.
94+
- Be aware that some Uniwind features, such as `withUniwind` and `useResolveClassNames` will not work in a server environment, as they rely on accessing `window` or `document`.

examples/next-16/next.config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import type { NextConfig } from "next";
22
import { withUniwind } from "uniwind-plugin-next";
33
import { withExpo } from "@expo/next-adapter";
4-
import { NormalModuleReplacementPlugin } from "webpack";
54

65
const nextConfig: NextConfig = {
76
webpack(config) {
87
if (!config.plugins) {
98
config.plugins = [];
109
}
1110

12-
config.plugins.push(
13-
new NormalModuleReplacementPlugin(
14-
/react-native-web\/dist\/exports\/StyleSheet\/dom\/createCSSStyleSheet/,
15-
require.resolve("react-native-web-tailwind-compat/createCSSStyleSheet"),
16-
),
17-
);
18-
1911
return config;
2012
},
2113
};

examples/next-16/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"react-dom": "19.2.3",
1717
"react-native": "0.81",
1818
"react-native-web": "^0.21.2",
19-
"react-native-web-tailwind-compat": "workspace:*",
20-
"uniwind": "^1.2.4",
19+
"uniwind": "^1.2.7",
2120
"uniwind-plugin-next": "workspace:*"
2221
},
2322
"devDependencies": {

examples/next-16/src/app/ReactNativeWebStyleSheet.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
import { useRef } from "react";
44
import { useServerInsertedHTML } from "next/navigation";
5-
import { getServerStyleSheet } from "react-native-web-tailwind-compat";
5+
import { StyleSheet } from "react-native";
66

77
export function ReactNativeWebStyleSheet() {
88
const hasInserted = useRef(false);
99
useServerInsertedHTML(() => {
1010
if (hasInserted.current) return;
1111
hasInserted.current = true;
12-
const sheet = getServerStyleSheet();
12+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
13+
const sheet = (StyleSheet as any).getSheet();
1314

1415
return (
1516
<style

packages/react-native-web-tailwind-compat/README.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

packages/react-native-web-tailwind-compat/package.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

packages/react-native-web-tailwind-compat/src/__mocks__/react-native.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/react-native-web-tailwind-compat/src/__tests__/getServerStyleSheet.test.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

packages/react-native-web-tailwind-compat/src/createCSSStyleSheet.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)