@lunora/astro 1.0.0-alpha.7 → 1.0.0-alpha.9

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.
Files changed (2) hide show
  1. package/README.md +18 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -98,6 +98,24 @@ const preloaded = await preloadQuery(client, api.messages.list, {});
98
98
  <my-island data-preloaded={serializePreloaded(preloaded)}></my-island>
99
99
  ```
100
100
 
101
+ ### Feature flags
102
+
103
+ `@lunora/astro` ships no flag hook — like every other surface, flags follow the same server/island split. Read `ctx.flags` server-side (a server endpoint, a function, or the same `.astro` frontmatter) and hand the resolved value to the island, or call `useFlag` inside the island itself via the adapter you hydrate with (`@lunora/react`, `@lunora/vue`, …). Requires [`@lunora/flags`](https://www.npmjs.com/package/@lunora/flags) wired in `lunora/flags.ts`.
104
+
105
+ ```astro
106
+ ---
107
+ // src/pages/index.astro — resolve the flag once, server-side
108
+ import { createServerClient, preloadQuery, preloadedQueryResult } from "@lunora/astro/server";
109
+ import { api } from "../lunora/_generated/api";
110
+
111
+ const client = createServerClient({ url: Astro.url.origin + "/_lunora/rpc" });
112
+ const preloaded = await preloadQuery(client, api.homepage.heroFlag, {}); // a query that returns ctx.flags.boolean(...)
113
+ const newHero = preloadedQueryResult(preloaded);
114
+ ---
115
+
116
+ {newHero ? <NewHero client:load /> : <ClassicHero client:load />}
117
+ ```
118
+
101
119
  > This README covers the basics. For the full API, options, and guides, see the **[documentation](https://lunora.sh/docs/frameworks/bring-your-framework)**.
102
120
 
103
121
  ## Related
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/astro",
3
- "version": "1.0.0-alpha.7",
3
+ "version": "1.0.0-alpha.9",
4
4
  "description": "Astro integration for Lunora — single-worker composition plus reactive-loader server helpers",
5
5
  "keywords": [
6
6
  "astro",
@@ -50,8 +50,8 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@lunora/client": "1.0.0-alpha.3",
54
- "@lunora/runtime": "1.0.0-alpha.6"
53
+ "@lunora/client": "1.0.0-alpha.4",
54
+ "@lunora/runtime": "1.0.0-alpha.7"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "astro": "^6.0.0"