-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(svelte): Ensure client is loaded before use #465
base: main
Are you sure you want to change the base?
Conversation
…fy-client-loading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lexically LGTM. Can I test this somehow or even better, is this tested on CI somehow? If not, can it be?
You can test this locally by checking out this repo, installing scaffolding via
For now, are only ensuring that the ui generated by scaffolding can be built without producing any vite build or typescript errors. We had a discussion on testing the UI in the past on this spike #421, ready for refinement |
@@ -1,7 +1,83 @@ | |||
import { type AppClient } from "@holochain/client"; | |||
import { writable, type Writable } from 'svelte/store'; | |||
import { getContext, setContext } from 'svelte'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { getContext, setContext } from 'svelte'; | |
import { getContext } from 'svelte'; |
setContext is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, thanks
@@ -1,7 +1,83 @@ | |||
import { type AppClient } from "@holochain/client"; | |||
import { writable, type Writable } from 'svelte/store'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { writable, type Writable } from 'svelte/store'; | |
import { get, writable } from 'svelte/store'; |
type Writable
not used, get
missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks
import { type ClientContext, clientContext } from '../../contexts'; | ||
import { onMount } from 'svelte'; | ||
import type { EntryHash, Record, AgentPubKey, ActionHash, Link, NewEntryAction, HolochainError } from '@holochain/client'; | ||
import { SignalType } from '@holochain/client'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SignalType
was removed from holochain-client-js due to changes in enum serialization: see https://github.com/holochain/holochain-client-js/pull/322/files#
I think there's a few other places in this PR that use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, this was a left over change while fixing merge conflicts, thanks for catching
I'm running into a few unrelated issues that are preventing me from testing this:
I'll make issues in the corresponding repos. Have you been able to run this @c12i? |
Feel free to open, I suspect the error might be related to the change in enum serialization as well. Last manual testing was done on |
I'm working on bumping hc-spin and hc-launch right now. hc-launch PR is ready for review here. Once merged, I will udpate holonix. |
Closes #466
This PR adds measures to ensure the client is not accessible before its initialized. This is achieved by moving the client state to a global state and and sharing it across child components.
Blocked by failing CI