Skip to content

Commit

Permalink
update statebuilder with provider directive
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Nov 4, 2024
1 parent cecd3b8 commit fae982c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
3 changes: 3 additions & 0 deletions packages/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const defaultConfig: ViteCustomizableConfig = {
statebuilder({
transformStores: ['eDefineAsync'],
autoKey: true,
experimental: {
transformStateProviderDirective: true,
},
}),
],
optimizeDeps: {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"solid-js": "^1.9.3",
"solid-jsx": "^1.1.4",
"solid-mdx": "^0.0.7",
"statebuilder": "^0.7.1",
"statebuilder": "^0.7.2",
"unique-names-generator": "^4.7.1",
"vinxi": "^0.4.3",
"vscode-languageserver-protocol": "^3.17.5",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface EditorProps {
}

export function Editor(props: EditorProps) {
'use stateprovider';
const editorUi = provideState(EditorUiStore);
const editor = provideState(EditorStore);

Expand Down
6 changes: 2 additions & 4 deletions packages/app/src/routes/editor/[...path].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type RouteDefinition,
type RouteSectionProps,
} from '@solidjs/router';
import {provideState, StateProvider} from 'statebuilder';
import {provideState} from 'statebuilder';
import {Editor} from '~/components/Editor/Editor';
import {
EditorContext,
Expand Down Expand Up @@ -68,9 +68,7 @@ export default function EditorPage(props: RouteSectionProps) {
user,
}}
>
<StateProvider>
<Editor type={'repository'} />
</StateProvider>
<Editor type={'repository'} />
</EditorContext.Provider>
);
}
4 changes: 1 addition & 3 deletions packages/app/src/routes/editor/scratch/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export default function EditorPage(props: RouteSectionProps) {
user,
}}
>
<StateProvider>
<Editor type={'scratch'} />
</StateProvider>
<Editor type={'scratch'} />
</EditorContext.Provider>
)}
</Show>
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fae982c

Please sign in to comment.