Skip to content

Commit 3afa5f6

Browse files
committed
Refactor llms.txt to streamline devtools setup instructions, removing unnecessary code snippets and clarifying that certain configurations should only be executed in a development environment. Update testing guidelines by removing outdated tests and focusing on relevant subscription handling.
1 parent 4b15710 commit 3afa5f6

1 file changed

Lines changed: 2 additions & 33 deletions

File tree

llms.txt

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,15 @@ npm i -D @flexsurfer/reflex-devtools
9999
Enable in your app entry point (`main.tsx`) before dispatching any events:
100100

101101
```ts
102-
import { dispatch, enableTracing } from '@flexsurfer/reflex';
102+
import { enableTracing } from '@flexsurfer/reflex';
103103
import { enableDevtools } from '@flexsurfer/reflex-devtools';
104104

105105
enableTracing(); // required — turns on the trace pipeline that devtools reads
106106
enableDevtools(); // opens the devtools connection
107107

108-
dispatch([EVENT_IDS.APP_INIT]);
109108
```
110109

111-
`enableTracing()` activates internal trace collection for events, subscriptions, and renders. `enableDevtools()` hooks into those traces and exposes them to the devtools UI / MCP server. Both calls are cheap no-ops in production when tree-shaken behind a `process.env.NODE_ENV` guard.
112-
113-
If your app uses Vite with local source aliases (monorepo / examples), make sure reflex-devtools resolves the same Reflex instance:
114-
115-
```ts
116-
// vite.config.ts
117-
resolve: {
118-
alias: {
119-
'@flexsurfer/reflex': path.resolve(__dirname, '../../src')
120-
}
121-
},
122-
optimizeDeps: {
123-
exclude: ['@flexsurfer/reflex-devtools']
124-
}
125-
```
110+
this code should be run only in dev env.
126111

127112
## 8) Test Minimum
128113

@@ -175,24 +160,13 @@ it('ADD_TODO should ignore empty input', () => {
175160
```
176161

177162
### Testing Subscriptions
178-
179-
Root subscriptions: call `initAppDb(mockDB)` then call `handler()` with no arguments.
180163
Computed subscriptions: call `handler(inputFromParentSub1, inputFromParentSub2, ...)` directly — the handler receives its parent subscription values as positional arguments.
181-
Dependency checks: use `getHandler('subDeps', SUB_ID)` to verify the subscription's input signals.
182164

183165
```ts
184166
import { getHandler, initAppDb } from '@flexsurfer/reflex';
185167
import type { SubHandler, SubDepsHandler } from '@flexsurfer/reflex';
186168
import './subs';
187169

188-
it('TODOS root sub returns todos from db', () => {
189-
const handler = getHandler('sub', SUB_IDS.TODOS) as SubHandler;
190-
const mockDB = { todos: [{ id: 1, title: 'Test', done: false }] };
191-
initAppDb(mockDB);
192-
193-
expect(handler()).toBe(mockDB.todos);
194-
});
195-
196170
it('OPEN_COUNT computed sub counts active todos', () => {
197171
const handler = getHandler('sub', SUB_IDS.TODOS_OPEN_COUNT) as SubHandler;
198172
const todos = [
@@ -203,11 +177,6 @@ it('OPEN_COUNT computed sub counts active todos', () => {
203177

204178
expect(handler(todos)).toBe(2);
205179
});
206-
207-
it('OPEN_COUNT has correct dependency chain', () => {
208-
const depsHandler = getHandler('subDeps', SUB_IDS.TODOS_OPEN_COUNT) as SubDepsHandler;
209-
expect(depsHandler()).toEqual([[SUB_IDS.TODOS]]);
210-
});
211180
```
212181

213182
## 9) AI Generation Checklist

0 commit comments

Comments
 (0)