Skip to content
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

Call into JSON-LD via its WebIDL API instead of calling algorithms directly #100

Open
jyasskin opened this issue Nov 7, 2024 · 2 comments
Assignees
Labels
CR1 discuss editorial This item is editorial in nature.

Comments

@jyasskin
Copy link
Member

jyasskin commented Nov 7, 2024

In the discussion at w3c/json-ld-api#580 (comment), @gkellogg says that specs should always use the JSON-LD API instead of calling directly into JSON-LD algorithms. data-cite="JSON-LD11-API seems to be a good search term in this spec to find places that need fixing.

@msporny
Copy link
Member

msporny commented Nov 17, 2024

Hmm, I'm not sure this is necessary. We've got upwards of 17 implementations at this point and none of them seem to have been tripped up by this not calling into the JSON-LD algorithms using the WebIDL interfaces. Additionally, given that browsers don't implement the WebIDL interfaces, and don't plan to (AFAIK), I'm not seeing the benefit of making this change.

Out of curiosity, exactly how should the text change to use the WebIDL API?

/cc @gkellogg @dlongley @BigBlueHat @davidlehn to get more opinions if there is something for us to do here.

@msporny msporny added editorial This item is editorial in nature. CR1 discuss labels Nov 17, 2024
@msporny msporny self-assigned this Nov 17, 2024
@gkellogg
Copy link
Member

The reason for this recommendation is that the algorithms make use of options set the API (e.g., compactArrays, documentLoader, processingMode, ...). That's not to say that you can't use the algorithms directly, but where they call for using the value (explicit or default) of an API option, you'll need to take a separate provision for this.

As long as dependent specs are cognizant of this (e.g., using xxx for documentLoader) it should be fine, but the algorithms to take advantage of the envelope the API method steps provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR1 discuss editorial This item is editorial in nature.
Projects
None yet
Development

No branches or pull requests

3 participants