Loading CHANGES.md +20 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,13 @@ Version 1.1.12 To be released. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.1.11 -------------- Loading Loading @@ -297,6 +304,19 @@ Released on October 20, 2024. [#150]: https://github.com/dahlia/fedify/issues/150 Version 1.0.15 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.0.14 -------------- Loading src/codegen/__snapshots__/class.test.ts.snap +426 −330 File changed.Preview size limit exceeded, changes collapsed. Show changes src/codegen/class.ts +9 −2 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ async function* generateClass( yield ` readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; #cachedJsonLd?: unknown; readonly id: URL | null; protected get _documentLoader(): DocumentLoader | undefined { Loading @@ -59,11 +60,17 @@ async function* generateClass( protected get _contextLoader(): DocumentLoader | undefined { return this.#contextLoader; } protected get _cachedJsonLd(): unknown | undefined { return this.#cachedJsonLd; } protected set _cachedJsonLd(value: unknown | undefined) { this.#cachedJsonLd = value; } `; } yield ` #cachedJsonLd?: unknown; /** * The type URI of {@link ${type.name}}: \`${typeUri}\`. */ Loading src/codegen/codec.ts +3 −3 Original line number Diff line number Diff line Loading @@ -32,8 +32,8 @@ export async function* generateEncoder( contextLoader?: DocumentLoader, context?: string | Record<string, string> | (string | Record<string, string>)[], } = {}): Promise<unknown> { if (options.format == null && this.#cachedJsonLd != null) { return this.#cachedJsonLd; if (options.format == null && this._cachedJsonLd != null) { return this._cachedJsonLd; } if (options.format !== "compact" && options.context != null) { throw new TypeError( Loading Loading @@ -403,7 +403,7 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { instance.#cachedJsonLd = structuredClone(json); instance._cachedJsonLd = structuredClone(json); } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", Loading src/codegen/property.ts +2 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ async function* generateProperty( await this.#fetch${toPascalCase(property.singularName)}(v, options); if (fetched == null) return null; this.${await getFieldName(property.uri)}[0] = fetched; this._cachedJsonLd = undefined; return fetched; } return v; Loading Loading @@ -162,6 +163,7 @@ async function* generateProperty( v, options); if (fetched == null) continue; vs[i] = fetched; this._cachedJsonLd = undefined; yield fetched; continue; } Loading Loading
CHANGES.md +20 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,13 @@ Version 1.1.12 To be released. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.1.11 -------------- Loading Loading @@ -297,6 +304,19 @@ Released on October 20, 2024. [#150]: https://github.com/dahlia/fedify/issues/150 Version 1.0.15 -------------- Released on February 10, 2025. - Fixed a bug with nested object hydration in Activity Vocabulary API where deeply nested properties (like `Object.getAttribution()` on `Activity.getObject()`) were't being properly hydrated during `toJsonLd()` calls. Previously, subsequent calls to `toJsonLd()` on nested objects could result in inconsistent JSON-LD output where nested objects remained as URLs instead of being fully expanded. Version 1.0.14 -------------- Loading
src/codegen/__snapshots__/class.test.ts.snap +426 −330 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/codegen/class.ts +9 −2 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ async function* generateClass( yield ` readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; #cachedJsonLd?: unknown; readonly id: URL | null; protected get _documentLoader(): DocumentLoader | undefined { Loading @@ -59,11 +60,17 @@ async function* generateClass( protected get _contextLoader(): DocumentLoader | undefined { return this.#contextLoader; } protected get _cachedJsonLd(): unknown | undefined { return this.#cachedJsonLd; } protected set _cachedJsonLd(value: unknown | undefined) { this.#cachedJsonLd = value; } `; } yield ` #cachedJsonLd?: unknown; /** * The type URI of {@link ${type.name}}: \`${typeUri}\`. */ Loading
src/codegen/codec.ts +3 −3 Original line number Diff line number Diff line Loading @@ -32,8 +32,8 @@ export async function* generateEncoder( contextLoader?: DocumentLoader, context?: string | Record<string, string> | (string | Record<string, string>)[], } = {}): Promise<unknown> { if (options.format == null && this.#cachedJsonLd != null) { return this.#cachedJsonLd; if (options.format == null && this._cachedJsonLd != null) { return this._cachedJsonLd; } if (options.format !== "compact" && options.context != null) { throw new TypeError( Loading Loading @@ -403,7 +403,7 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { instance.#cachedJsonLd = structuredClone(json); instance._cachedJsonLd = structuredClone(json); } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", Loading
src/codegen/property.ts +2 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ async function* generateProperty( await this.#fetch${toPascalCase(property.singularName)}(v, options); if (fetched == null) return null; this.${await getFieldName(property.uri)}[0] = fetched; this._cachedJsonLd = undefined; return fetched; } return v; Loading Loading @@ -162,6 +163,7 @@ async function* generateProperty( v, options); if (fetched == null) continue; vs[i] = fetched; this._cachedJsonLd = undefined; yield fetched; continue; } Loading