potatejs 1.0.0-beta.1 → 1.0.0-beta.10
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 +12 -5
- package/bin/potate-cli.mjs +1 -1
- package/dist/astro-integration.js +2 -24
- package/dist/astro-render.js +2 -1
- package/dist/chunk-O3JMYIZZ.js +25 -0
- package/dist/chunk-QRCR45N4.js +2 -0
- package/dist/{index-esbuild.js → index-esbuild-jsx.js} +162 -85
- package/dist/{index-vite.js → index-vite-jsx.js} +161 -84
- package/dist/index.js +4 -4
- package/dist/renderToString.js +1 -0
- package/dist/vite-integration.js +331 -0
- package/package.json +13 -11
- package/dist/ssr-vite.js +0 -1
package/README.md
CHANGED
|
@@ -60,6 +60,7 @@ Now, you can use not only Astro components (`.astro`) but also Potate JSX compon
|
|
|
60
60
|
> **Note:** Potate components in Astro Islands
|
|
61
61
|
>
|
|
62
62
|
> * **No directive (Server Only)**: Rendered as just static HTML tags. It results in zero client-side JavaScript. (I used to think there wasn't much point in writing static content in JSX components instead of just using Astro components. It seemed like standard Astro components was more than enough. **However, I've realized one major advantage:** [SSR Emotion for Astro](docs/SSR_EMOTION_FOR_ASTRO.md) — the ultimate SSR Zero-Runtime CSS-in-JS solution, seamlessly integrated with Astro. By using Potate JSX components, your styles are automatically extracted into static CSS during the build process. This means you can enjoy the full power of CSS-in-JS while still shipping zero bytes of JS to the browser. In this regard, it's a significant upgrade over standard Astro components.)
|
|
63
|
+
>
|
|
63
64
|
> * `client:only="potate"` **(Client Only)**: This is the mode where the relationship between Potate and Astro is the clearest. (In this context, Potate plays the same role as React in other integrations.) It skips server-side rendering and runs entirely in the browser.
|
|
64
65
|
>
|
|
65
66
|
> * `client:load`(and others like `client:visible` or `client:idle`) **(SSR Hydration)**: Despite its cool and flashy name, "SSR Hydration" is not that complicated: it just creates a static HTML skeleton first, and once the JS is ready, the engine takes over the DOM as if it had been there from the start. If you are particular about the visual transition—like ensuring there is no layout shift by pre-setting an image's height—you might want to take control to make the swap feel completely natural.
|
|
@@ -81,12 +82,16 @@ npm install potatejs
|
|
|
81
82
|
|
|
82
83
|
Add Potate in your `vite.config.ts` file.
|
|
83
84
|
|
|
85
|
+
> **Note:** What is the `clientOnly` option? See [SSR Emotion for Vite](/docs/SSR_EMOTION_FOR_VITE.md#using-pure-vite-standard-csr-only).
|
|
86
|
+
|
|
84
87
|
``` js
|
|
85
88
|
import { defineConfig } from 'vite'
|
|
86
89
|
import potate from 'potatejs/vite'
|
|
87
90
|
|
|
88
91
|
export default defineConfig({
|
|
89
|
-
plugins: [potate(
|
|
92
|
+
plugins: [potate({
|
|
93
|
+
clientOnly: true,
|
|
94
|
+
})],
|
|
90
95
|
})
|
|
91
96
|
|
|
92
97
|
```
|
|
@@ -303,10 +308,11 @@ For the above example, the Brahmos output is 685 bytes, compared to 824 bytes fr
|
|
|
303
308
|
- [x] React Utilities and Methods
|
|
304
309
|
- [x] ⭐⭐⭐ Vite Plugin to transpile JSX to tagged templates
|
|
305
310
|
- [x] ⭐⭐⭐ Esbuild Plugin to transpile JSX to tagged templates
|
|
306
|
-
- [x] ⭐⭐⭐ [Potate Native Component(PNC)](docs/POTATE_NATIVE_COMPONENT.md)
|
|
307
|
-
- [x] ⭐⭐⭐ [SSR Emotion for Astro](docs/SSR_EMOTION_FOR_ASTRO.md)
|
|
308
|
-
- [x] ⭐⭐⭐ [
|
|
309
|
-
- [x] ⭐⭐⭐ [
|
|
311
|
+
- [x] ⭐⭐⭐ [Potate Native Component(PNC)](/docs/POTATE_NATIVE_COMPONENT.md)
|
|
312
|
+
- [x] ⭐⭐⭐ [SSR Emotion for Astro](/docs/SSR_EMOTION_FOR_ASTRO.md)
|
|
313
|
+
- [x] ⭐⭐⭐ [SSR Emotion for Vite](/docs/SSR_EMOTION_FOR_VITE.md)
|
|
314
|
+
- [x] ⭐⭐⭐ [reacty(ReactComponent) API](/docs/API.md)
|
|
315
|
+
- [x] ⭐⭐⭐ [watch(resource) API](/docs/API.md)
|
|
310
316
|
- [x] ⭐ The Lanes Light **(Though I haven't cleaned up the no-longer-needed TRANSITION_STATE_TIMED_OUT yet.)**
|
|
311
317
|
- [x] ⭐ The Standalone `startTransition`
|
|
312
318
|
- [x] ⭐ Enhanced `useTransition` hook
|
|
@@ -338,6 +344,7 @@ For the above example, the Brahmos output is 685 bytes, compared to 824 bytes fr
|
|
|
338
344
|
|
|
339
345
|
* Potate Server Components (PSC)
|
|
340
346
|
* Potate Compiler
|
|
347
|
+
* Async SSR
|
|
341
348
|
* `useSyncExternalStore` hook
|
|
342
349
|
* `useOptimistic` hook
|
|
343
350
|
* Superficial Type Definitions: We do not provide type information solely to satisfy IDE warnings unless it directly impacts runtime execution safety.
|