@s-ui/bundler 9.79.0-beta.3 → 9.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -184,6 +184,10 @@ This tool works with zero configuration out the box but you could use some confi
184
184
 
185
185
  `disableTypeScriptLoader`: Flag to determine if typescript loader should be used. (default: `false`)
186
186
 
187
+ `plainCssPackages`: Array of npm package names whose `.css` files should bypass `@s-ui/sass-loader` and `postcss-loader`. Use this for packages that ship pre-compiled CSS (e.g. Tailwind CSS v4 output) that would cause Sass parse errors. (default: `[]`)
188
+
189
+ `cssInAppStyles`: Array of npm package names whose CSS modules should be forced into the `AppStyles` chunk. This prevents webpack's `splitChunks` from extracting them into separate async chunks that `@s-ui/ssr` doesn't know about — avoiding Flash of Unstyled Content. (default: `[]`)
190
+
187
191
  ```json
188
192
  {
189
193
  "config": {
@@ -202,6 +206,8 @@ This tool works with zero configuration out the box but you could use some confi
202
206
  "dev": "cheap-module-eval-source-map",
203
207
  "prod": "hidden-source-map"
204
208
  },
209
+ "plainCssPackages": ["@adv-mt/ui", "@adv-mt/theme"],
210
+ "cssInAppStyles": ["@adv-mt/ui", "@adv-mt/theme"],
205
211
  "disableTypeScriptLoader": true // Only if you want to disable typescript loader
206
212
  }
207
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "9.79.0-beta.3",
3
+ "version": "9.79.0",
4
4
  "description": "Config-free bundler for ES6 React apps.",
5
5
  "bin": {
6
6
  "sui-bundler": "./bin/sui-bundler.js"
@@ -74,7 +74,7 @@ const webpackConfig = {
74
74
  compression: false
75
75
  },
76
76
  plugins: cleanList([
77
- ...plainCssSplitChunks().plugins || [],
77
+ ...(plainCssSplitChunks().plugins || []),
78
78
  new webpack.ProvidePlugin({
79
79
  process: 'process/browser.js'
80
80
  }),
@@ -1,71 +0,0 @@
1
- # Tailwind v4 integration in `@s-ui/bundler` — investigation & alternatives
2
-
3
- ## Context
4
-
5
- - `@adv-mt/ui` (Milanuncios DS) ships Tailwind **v4** CSS via `@tailwindcss/postcss`.
6
- - `@adv-re/ui` (Fotocasa DS) uses Tailwind **v3**.
7
- - `@s-ui/bundler` (`9.78.0`) hard-pins `tailwindcss@3.4.14` and enables the plugin only when a `tailwind.config.js` file exists at the project root.
8
- - Tailwind v4 has an incompatible API: CSS-first config (`@import "tailwindcss"`, `@source`, `@theme`), no JS config by default, plugin renamed to `@tailwindcss/postcss`, built-in vendor prefixing.
9
-
10
- Relevant code: `packages/sui-bundler/shared/module-rules-sass.js`, `shared/index.js` (`isTailwindEnabled`), `webpack.config.dev.js`, `webpack.config.client.dev.js`.
11
-
12
- Relevant external work:
13
- - MA integration PR — `frontend-ma--web-app#7667`
14
- - Strategy doc — `frontend-ma--web-app/docs/design-system-css-strategy.md`
15
- - Bundler PR — [SUI-Components/sui#1988](https://github.com/SUI-Components/sui/pull/1988) (`plainCssPackages` config to bypass sass-loader for plain CSS packages)
16
-
17
- ## Alternatives
18
-
19
- ### A. Land #1988 (`plainCssPackages`) — patch release
20
-
21
- Bypass sass + postcss for pre-built DS CSS. No Tailwind upgrade.
22
-
23
- - Pros: zero risk for Fotocasa; unblocks MA today; small surface.
24
- - Cons: doesn't enable app-build Tailwind (Option 2 in MA's strategy doc); MA keeps shipping the full pre-built `@adv-mt/ui/styles.css`.
25
-
26
- ### B. Peer-dep Tailwind — major (v10) — **recommended**
27
-
28
- Remove `tailwindcss` from bundler deps. Consumer installs `tailwindcss@3` OR `tailwindcss@4` + `@tailwindcss/postcss`. Bundler detects which is installed and wires the correct postcss plugin.
29
-
30
- - Pros: no forced migration; each team upgrades on its own schedule; future-proof; bundler owns no Tailwind bugs.
31
- - Cons: more setup for consumers (one extra install); detection logic in bundler.
32
-
33
- ### C. Hard upgrade v3 → v4 — major (v10)
34
-
35
- Replace `tailwindcss@3` with `@tailwindcss/postcss@4`. Drop `tailwind.config.js` detection. Fotocasa migrates via `npx @tailwindcss/upgrade`.
36
-
37
- - Pros: clean, single path forward.
38
- - Cons: forces Fotocasa work; release coordination.
39
-
40
- ### D. Dual-mode flag — major (v10)
41
-
42
- Ship both `tailwindcss@3` and `@tailwindcss/postcss@4`. Detect entry (`tailwind.config.js` → v3, `tailwind.css`/CSS-first → v4) and pick plugin per project. Remove v3 in v11.
43
-
44
- - Pros: smooth ramp; opt-in v4.
45
- - Cons (maintenance is moderate, not trivial):
46
- - Two Tailwind deps shipped — bigger install for every consumer, even single-version ones.
47
- - Branching pipeline lives in `module-rules-sass.js` + 3 webpack configs.
48
- - Two doc paths in README.
49
- - Test matrix doubles — every bundler release verified against v3 and v4.
50
- - Bug surface: plugin order, autoprefixer overlap with v4's built-in prefixing, sourcemaps differ.
51
- - Sunset still requires Fotocasa migration in v11 — work is deferred, not avoided.
52
- - Verdict: real cost is owning v3 bugs in sui-bundler for ~a year. Worse than B unless Fotocasa explicitly wants zero-effort upgrade.
53
-
54
- ### E. Skip bundler change; push DS to per-component CSS exports
55
-
56
- Pair with #1988. DS publishes `@adv-mt/ui/button/styles.css` etc. Sidesteps v4-in-bundler entirely until both teams want app-build Tailwind.
57
-
58
- - Pros: no bundler v10 needed.
59
- - Cons: requires DS build changes; consumer tracks per-page imports; no automatic tree-shaking.
60
-
61
- ## Recommendation
62
-
63
- 1. **Now** — merge #1988, patch release. Unblocks MA today, zero risk to Fotocasa.
64
- 2. **Next major (v10)** — option **B** (peer-dep). Best ergonomics across teams; lets each move independently; gives MA the path to app-build Tailwind v4 without forcing Fotocasa.
65
- 3. **Fallback** if peer-dep complexity is too high → option **D**, drop v3 in v11.
66
-
67
- ## Open questions
68
-
69
- - Does Fotocasa have appetite to migrate to v4 (with codemod) within v10's window? If yes, **C** becomes viable and simpler than B.
70
- - Are there other sui-bundler consumers using Tailwind v3? Audit before committing to B/C/D.
71
- - Does autoprefixer need to be removed/conditional under v4? v4 has built-in vendor prefixing.