@feedlog-ai/react 0.0.35 → 0.0.36
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 +3 -38
- package/dist/next.d.ts +0 -1
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +2 -3
- package/dist/next.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ const nextConfig = {
|
|
|
92
92
|
export default withFeedlogSSR(nextConfig);
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
Then
|
|
95
|
+
Then import components from `@feedlog-ai/react` as usual.
|
|
96
96
|
|
|
97
97
|
### Vite / Remix
|
|
98
98
|
|
|
@@ -163,44 +163,9 @@ The compiler-based SSR (used by Vite, Remix, and Next.js with `feedlogSSR` / `wi
|
|
|
163
163
|
|
|
164
164
|
This is a [documented limitation](https://stenciljs.com/docs/server-side-rendering) of Stencil's compiler approach ("Static props only").
|
|
165
165
|
|
|
166
|
-
###
|
|
166
|
+
### Build Your Own Feedlog (Full SSR)
|
|
167
167
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<details>
|
|
171
|
-
<summary>LLM instructions: Build an SSR-compatible issues component</summary>
|
|
172
|
-
|
|
173
|
-
Copy the following into your LLM to generate a custom SSR-compatible issues component:
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
**Context:** The `@stencil/ssr` compiler cannot resolve dynamic props at build time. For full SSR of the issues list, fetch data on the server and pass it to `FeedlogIssues`. Use `FeedlogSDK` from `@feedlog-ai/core` or direct `fetch()` to the Feedlog API.
|
|
178
|
-
|
|
179
|
-
**Implementation patterns:**
|
|
180
|
-
|
|
181
|
-
- **Next.js App Router:** Create an async Server Component that calls `new FeedlogSDK({ apiKey }).fetchIssues()`, then renders `<FeedlogIssues issues={issues} ... />`. Import `FeedlogIssues` from `@feedlog-ai/react`.
|
|
182
|
-
- **Next.js Pages Router:** Use `getServerSideProps` or `getStaticProps` to fetch issues, pass to the page, and render `<FeedlogIssues issues={issues} />`.
|
|
183
|
-
- **Vite / Remix:** Fetch in the route loader, pass data to the page component, and render `FeedlogIssues` with the fetched `issues` array.
|
|
184
|
-
|
|
185
|
-
**Important:** The wrapper must run on the server so props are resolved at request time. Import from `@feedlog-ai/react` (not `@feedlog-ai/react/ssr-components` or `@feedlog-ai/react/next` for the issues components).
|
|
186
|
-
|
|
187
|
-
**Example (Next.js App Router):**
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
// app/issues/page.tsx
|
|
191
|
-
import { FeedlogIssues } from '@feedlog-ai/react';
|
|
192
|
-
import { FeedlogSDK } from '@feedlog-ai/core';
|
|
193
|
-
|
|
194
|
-
export default async function IssuesPage() {
|
|
195
|
-
const sdk = new FeedlogSDK({ apiKey: process.env.FEEDLOG_API_KEY! });
|
|
196
|
-
const { issues } = await sdk.fetchIssues({ limit: 10 });
|
|
197
|
-
return <FeedlogIssues issues={issues} theme="light" />;
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
</details>
|
|
168
|
+
For full SSR of the issues list (no flash of empty content), build a custom wrapper that fetches on the server and passes data to `FeedlogIssues`. See [Build Your Own Feedlog](../../docs/BUILD_YOUR_OWN_FEEDLOG.md) for copy-paste instructions for AI assistants and code generators.
|
|
204
169
|
|
|
205
170
|
### Event Handling
|
|
206
171
|
|
package/dist/next.d.ts
CHANGED
package/dist/next.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,8BAMlD,CAAC"}
|
package/dist/next.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import stencilSSR from '@stencil/ssr/next';
|
|
2
|
-
export * from './server.js';
|
|
3
2
|
export const withFeedlogSSR = (nextConfig) => stencilSSR({
|
|
4
|
-
module: import('
|
|
5
|
-
from: '@feedlog-ai/react
|
|
3
|
+
module: import('@feedlog-ai/react/ssr-components'),
|
|
4
|
+
from: '@feedlog-ai/react',
|
|
6
5
|
hydrateModule: import('@feedlog-ai/webcomponents/hydrate'),
|
|
7
6
|
serializeShadowRoot: { default: 'declarative-shadow-dom' },
|
|
8
7
|
})(nextConfig);
|
package/dist/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAmC,EAAE,EAAE,CACpE,UAAU,CAAC;IACT,MAAM,EAAE,MAAM,CAAC,kCAAkC,CAAC;IAClD,IAAI,EAAE,mBAAmB;IACzB,aAAa,EAAE,MAAM,CAAC,mCAAmC,CAAC;IAC1D,mBAAmB,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;CAC3D,CAAC,CAAC,UAAU,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedlog-ai/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"description": "React bindings for Feedlog Toolkit Web Components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"react-dom": ">=17.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@feedlog-ai/webcomponents": "^0.0.
|
|
51
|
+
"@feedlog-ai/webcomponents": "^0.0.36"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@jest/test-sequencer": "^29.7.0",
|