Skip to content

Commit

Permalink
match packages versions
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Nov 30, 2023
1 parent 142564c commit ab691ea
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
12 changes: 4 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/fastui-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pydantic/fastui-bootstrap",
"version": "0.0.1",
"version": "0.0.6",
"description": "Boostrap renderer for FastUI",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -29,6 +29,6 @@
"sass": "^1.69.5"
},
"peerDependencies": {
"fastui": "0.0.1"
"@pydantic/fastui": "0.0.5"
}
}
2 changes: 1 addition & 1 deletion packages/fastui-prebuilt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pydantic/fastui-prebuilt",
"version": "0.0.3",
"version": "0.0.6",
"description": "Pre-built files for FastUI",
"main": "dist/index.html",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions packages/fastui-prebuilt/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default () => {
preview: serverConfig,
build: {
sourcemap: true,
// we don't need hashes in URLs, we the URL will change when we release a new version
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
Expand Down
2 changes: 1 addition & 1 deletion packages/fastui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pydantic/fastui",
"version": "0.0.1",
"version": "0.0.6",
"description": "Build better UIs faster.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
7 changes: 3 additions & 4 deletions packages/fastui/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ export function useRequest(): (args: RequestArgs) => Promise<[number, any]> {
}

export function useSSE(url: string, onMessage: (data: any) => void): void {
const { setError } = useContext(ErrorContext)

useEffect(() => {
const source = new EventSource(url)
source.onmessage = (e) => {
const data = JSON.parse(e.data)
onMessage(data)
}
source.onerror = (e) => {
setError({ title: 'SSE Error', description: (e as any)?.message || `SSE error, URL '${url}'` })
// we don't raise an error her as this can happen when the server is restarted
console.debug('SSE error', e)
}
const cleanup = () => {
source.onerror = null
Expand All @@ -39,7 +38,7 @@ export function useSSE(url: string, onMessage: (data: any) => void): void {
window.removeEventListener('beforeunload', cleanup)
cleanup()
}
}, [url, setError, onMessage])
}, [url, onMessage])
}

export interface RequestArgs {
Expand Down
2 changes: 1 addition & 1 deletion python/fastui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FastUI(pydantic.RootModel):
root: list[AnyComponent]


_PREBUILT_VERSION = '0.0.3'
_PREBUILT_VERSION = '0.0.6'
_PREBUILT_CDN_URL = f'https://cdn.jsdelivr.net/npm/@pydantic/fastui-prebuilt@{_PREBUILT_VERSION}/dist/assets'


Expand Down

0 comments on commit ab691ea

Please sign in to comment.