@awc-ui/react 1.0.0-beta.2 → 1.0.0-beta.3
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 +32 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -30,6 +30,38 @@ For styled markup on first paint (Next.js App Router and other SSR setups), impo
|
|
|
30
30
|
import { MdButton } from '@awc-ui/react/server';
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
## Smaller bundles
|
|
34
|
+
|
|
35
|
+
Tree-shaking works out of the box: importing a component ships only that component plus the shared runtime. Two opt-ins shrink things further.
|
|
36
|
+
|
|
37
|
+
**Client-only build** — if your app never server-renders, alias the core components to the CSR build, which compiles out the Declarative-Shadow-DOM hydration support (≈3 kB gz):
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// vite.config.ts
|
|
41
|
+
resolve: {
|
|
42
|
+
alias: [
|
|
43
|
+
{ find: '@awc-ui/core/dist/components', replacement: '@awc-ui/core/dist/components-csr' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Remove the alias if you adopt SSR — the hydrating build is the default for a reason.
|
|
49
|
+
|
|
50
|
+
**Preact** — the wrappers are `preact/compat`-safe. Since the components are web components, React only provides thin glue, and swapping it for Preact saves ≈50 kB gz with three aliases (most specific first; `react/jsx-runtime` maps automatically):
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
// vite.config.ts — and `npm i preact` (keep react + @types for type-checking)
|
|
54
|
+
resolve: {
|
|
55
|
+
alias: [
|
|
56
|
+
{ find: 'react-dom/client', replacement: 'preact/compat/client' },
|
|
57
|
+
{ find: 'react-dom', replacement: 'preact/compat' },
|
|
58
|
+
{ find: 'react', replacement: 'preact/compat' },
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Caveats: no React DevTools/concurrent features, and libraries that touch React internals may misbehave — evaluate for your app.
|
|
64
|
+
|
|
33
65
|
## Documentation
|
|
34
66
|
|
|
35
67
|
Component docs, theming, and per-component manuals ship with [`@awc-ui/core`](https://www.npmjs.com/package/@awc-ui/core).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awc-ui/react",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"description": "React wrapper for AWC UI Material Design 3 components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=18",
|
|
48
48
|
"react-dom": ">=18",
|
|
49
|
-
"@awc-ui/core": "1.0.0-beta.
|
|
49
|
+
"@awc-ui/core": "1.0.0-beta.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^20.14.0",
|
|
53
53
|
"@types/react": "~18.2.79",
|
|
54
54
|
"@types/react-dom": "~18.2.25",
|
|
55
55
|
"typescript": "^5.4.0",
|
|
56
|
-
"@awc-ui/core": "1.0.0-beta.
|
|
56
|
+
"@awc-ui/core": "1.0.0-beta.3"
|
|
57
57
|
},
|
|
58
58
|
"license": "MIT",
|
|
59
59
|
"author": "AWC UI",
|