-
Notifications
You must be signed in to change notification settings - Fork 1
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
First draft of DiscoveryClient and SubscriptionClient #1
Conversation
I tried using LDO first but for shapes that define objects as |
8d9e5ac
to
cdc40f8
Compare
cdc40f8
to
93c08aa
Compare
Hey I'm sorry for my tardiness. This looks like a big refactor, so I'll bring it down and do some testing once everything is done.
It's a little counter-intuitive, but it's by design. The philosophy is that LDO should handle objects consistently. An ID needs to be accessed via the "@id" field, and an IRI object can't just be a string. It's to handle this usecase:
I know that use case doesn't apply to this scenario, but needing to use the "@id" field for IRI objects is a small price to pay for consistency. |
Besides, really great setup for testing, which I didn't change, there was only incomplete implementation of one function: You can run it locally and all the tests should pass. It would be great to hear your thoughts on the approach I took here. |
Sounds good. I'll clone this down and look at it, though I'll warn that I have quite a bit on my priority stack, so it might not be fore a few days. |
Thanks! I will also try to get in touch with @woutslabbinck who developed https://github.com/woutslabbinck/Solid-Notification maybe we could find a way to collaborate on one implementation which meets everyone's requirements. I would be happy if that worked out. |
I'm already starting to use this branch in sai-js |
I've installed it and tested it with following code and a CSS v6.0.1 with WebSocketChannel2023 enabled: const {DiscoveryClient} = require('@solid-notifications/discovery');
const {SubscriptionClient} = require('@solid-notifications/subscription');
async function main() {
// test client
const client = new DiscoveryClient(fetch)
const websocketURL = await client.findService("http://localhost:3000/resource.ttl","http://www.w3.org/ns/solid/notifications#WebSocketChannel2023")
console.log(websocketURL);
// test subscribing
const subscriptionClient = new SubscriptionClient(fetch)
const channel = await subscriptionClient.subscribe("http://localhost:3000/resource.ttl","http://www.w3.org/ns/solid/notifications#WebSocketChannel2023")
console.log(channel);
}
main() I haven't looked specifically into the code itself, but as of right now it works as how I expected it to work. One issue that I've had however is that while installing from a fresh clone, I've received the following error: error Couldn't find package "@solid-notifications/discovery@^0.1.0" required by "@solid-notifications/subscription@0.0.0" on the "npm" registry. Which I fixed by editing the package.json of discovery: If you want to release it, you might want to change the subscription package.json version also to 0.1.0 for consistency. |
93c08aa
to
a84aac7
Compare
Thanks for the review @woutslabbinck
I reverted all the versions to We probably can cut the version and release it as a separate step after merging this PR. |
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.
Looks good to me.
When merged as version 0.0.0 into this repo, I'll start a branch to add some documentation to the most important methods as well (just like I did in solid-notification-client).
I think that'll help others when trying to experiment with Solid Notifications.
I created a couple of issues which we can resolve in dedicated PRs https://github.com/o-development/solid-notification-client/issues IMO once we address #2 and #3 we should be able to release it as 0.1 and continue iterating from there. @jaxoncreed could you please review this PR and possibly merge 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.
Hey sorry for the delay LGTM.
TODO