Repository navigation
Read unsupported vocabulary properties by IRI #1356
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
Open
dahlia
wants to merge
33
commits into
fedify-dev:main
Choose a base branch
from
dahlia:feat/vocab/allow-unsupported-props
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+75,020
−5,509
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
de777c3
Add VocabularyObject and raw property helpers
dahlia 05451ed
Generate raw property readers in vocab modules
dahlia 4991f97
Add the raw-property-iri-invalid lint rule
dahlia 09b671e
Pair reparsed raw property nodes by id
dahlia f41f97a
Skip tokens and comments in lint IRI traversal
dahlia 037b525
Check only the read functions in the IRI lint rule
dahlia 7d750aa
Keep raw properties when a reparse changes class
dahlia 88dc292
Merge raw properties across a class change
dahlia 35b058b
Ignore URL objects bound to const in IRI lint
dahlia 32a23df
Update vocab-tools snapshots after rebase
dahlia 7365f13
Look up switch discriminants outside case scope
dahlia 401c86c
Decode single-quoted literals in IRI lint exactly
dahlia 09af565
Pair sibling-class properties by IRI
dahlia eddea18
Scope TypeScript namespace bodies in IRI lint
dahlia f3a54e5
Bind namespace and enum names in IRI lint
dahlia 89bde9e
Decode cached embedded objects in parent context
dahlia f9e9d5f
Bind only namespaces with values in IRI lint
dahlia c64ab91
Scope enum members in IRI lint
dahlia afc31b4
Validate IP literals in raw property IRIs
dahlia cfb759c
Handle import aliases in IRI lint scopes
dahlia e089cb7
Reference the issue in embedded context entries
dahlia 26bffc6
Keep the parent context order for embedded objects
dahlia 2fff197
Keep decoded objects under non-propagating contexts
dahlia 0a8cf22
Stop following outer constants from merged scopes
dahlia ecefc1a
Check embedded contexts for non-propagation too
dahlia 9338289
Track merged exports when resolving IRI lint helpers
dahlia 3865313
Reject invalid ports in raw property IRIs
dahlia 03d5993
Accept both @emnapi lines in Astro compat tests
dahlia 16a5c34
Keep inherited contexts out of cached JSON-LD
dahlia 4a56ef4
Bound context loads when checking cached keys
dahlia 79f49c5
Visit enum members once in IRI lint
dahlia bc83705
Keep received JSON-LD when contexts cannot be rebuilt
dahlia 4a18a47
Harden decoding of cached embedded objects
dahlia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| links: | ||
| '#1272': https://github.com/fedify-dev/fedify/issues/1272 | ||
| '#1356': https://github.com/fedify-dev/fedify/pull/1356 | ||
| --- | ||
| - Added the `raw-property-iri-invalid` rule, which reports property IRIs | ||
| passed to `getRawPropertyValues()` and `getRawPropertyValue()` that throw | ||
| at runtime, such as terms and JSON-LD keywords, and compact IRIs such as | ||
| `as:content`, which are looked up literally. With ESLint and Oxlint, the | ||
| `modules` option adds other vocabulary modules generated by | ||
| `@fedify/vocab-tools` to the default `@fedify/vocab`. [[#1272], [#1356]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| links: | ||
| '#1272': https://github.com/fedify-dev/fedify/issues/1272 | ||
| '#1356': https://github.com/fedify-dev/fedify/pull/1356 | ||
| --- | ||
| - Added the `VocabularyObject` interface, which every class generated by | ||
| `@fedify/vocab-tools` implements, and the `RawPropertyValue` type with its | ||
| `RawValueObject`, `RawNodeObject`, and `RawListObject` shapes for the | ||
| expanded JSON-LD values that `getRawPropertyValues()` returns. | ||
| [[#1272], [#1356]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| links: | ||
| '#1272': https://github.com/fedify-dev/fedify/issues/1272 | ||
| '#1356': https://github.com/fedify-dev/fedify/pull/1356 | ||
| --- | ||
| - Fixed generated accessors decoding embedded objects that have their own | ||
| `@context` without the enclosing document's context, which could | ||
| return objects of another class, drop property values, or pick objects | ||
| under a term the enclosing context mapped to another property. | ||
| [[#1272], [#1356]] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| links: | ||
| '#1272': https://github.com/fedify-dev/fedify/issues/1272 | ||
| '#1356': https://github.com/fedify-dev/fedify/pull/1356 | ||
| --- | ||
| - Generated vocabulary modules now export `getRawPropertyValues()` and | ||
| `getRawPropertyValue()`, which read any property of a generated object | ||
| by its full IRI, and their root classes implement `VocabularyObject` from | ||
| `@fedify/vocab-runtime`. Decoding retains the properties a class does not | ||
| know, so third-party vocabulary modules get the same access to | ||
| unsupported properties as `@fedify/vocab`. The functions accept objects | ||
| from any generated module. [[#1272], [#1356]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| links: | ||
| '#1272': https://github.com/fedify-dev/fedify/issues/1272 | ||
| '#1356': https://github.com/fedify-dev/fedify/pull/1356 | ||
|
dahlia marked this conversation as resolved.
Resolved
|
||
| --- | ||
| - Fixed accessors of objects decoded by `fromJsonLd()` returning wrong | ||
| values for embedded objects that have their own `@context`. Such an | ||
| object was decoded again from its cached JSON-LD without the enclosing | ||
| document's context, so a type or property term that only the enclosing | ||
| context defined could yield an object of another class or drop | ||
| property values. It could also pick embedded objects under a term that | ||
| the enclosing context mapped to another property. The accessors now | ||
| apply the enclosing context and fall back to the object decoded with the | ||
| whole document when the cached JSON-LD cannot be matched with it. | ||
| [[#1272], [#1356]] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| links: | ||
| '#1272': https://github.com/fedify-dev/fedify/issues/1272 | ||
| '#1356': https://github.com/fedify-dev/fedify/pull/1356 | ||
| --- | ||
| - Added `getRawPropertyValues()` and `getRawPropertyValue()` functions, | ||
| which read a property of a vocabulary object by its full IRI and return | ||
| its values in expanded JSON-LD. They let applications read properties | ||
| that Fedify has no accessor for, such as an extension used by only a few | ||
| peers, without depending on the JSON-LD serialization cache: unknown | ||
| properties are now retained when an object is decoded, including embedded | ||
| objects, and survive `clone()` and `deepClone()`. For properties Fedify | ||
| does support, the functions return the current typed values encoded back | ||
| into JSON-LD. The values are not verified, so validate them before use. | ||
| [[#1272], [#1356]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.