build: update dependency quicktype-core to v26 (main)#33622
build: update dependency quicktype-core to v26 (main)#33622angular-robot wants to merge 1 commit into
Conversation
See associated pull request for more information.
There was a problem hiding this comment.
Code Review
This pull request updates the quicktype-core dependency in package.json from 25.0.0 to 26.0.0. Feedback highlights that this upgrade introduces breaking changes to the default generated TypeScript code, such as generating string-literal unions instead of enums and unknown instead of any. It is recommended to update the rendererOptions in tools/quicktype_runner.js to preserve the previous behavior if these changes are not desired.
| "prettier": "^3.0.0", | ||
| "puppeteer": "25.3.0", | ||
| "quicktype-core": "25.0.0", | ||
| "quicktype-core": "26.0.0", |
There was a problem hiding this comment.
Upgrading quicktype-core to v26.0.0 introduces breaking changes to the default generated TypeScript code:\n- String-literal unions are now generated instead of enums.\n- unknown is now generated instead of any.\n\nSince tools/quicktype_runner.js is used to generate TypeScript files from JSON schemas, this upgrade will change the generated output and may break downstream TypeScript compilation if other packages rely on the generated enums or any types.\n\nIf you wish to preserve the previous behavior and avoid breaking changes, you should update rendererOptions in tools/quicktype_runner.js to disable these new defaults:\n\njavascript\nrendererOptions: {\n 'prefer-types': 'true',\n 'just-types': 'true',\n 'explicit-unions': 'true',\n 'acronym-style': 'camel',\n 'prefer-unions': 'false',\n 'prefer-unknown': 'false'\n}\n\n\nOtherwise, please verify that the generated code changes are acceptable and do not break any downstream consumers.
See associated pull request for more information. Closes angular#33622 as a pr takeover
This PR contains the following updates:
25.0.0→26.0.0Release Notes
glideapps/quicktype (quicktype-core)
v26.0.0: quicktype 26.0.0Compare Source
quicktype 26.0.0
quicktype 26 modernizes the default generated code across most target languages: current serialization frameworks, current language standards, and safer types. Because versions 24, 25, and 26 shipped in quick succession, many users will upgrade directly from 23.x — so this document calls out every breaking change since 23.2.6, not just changes since 25.1.0. Nearly every changed generated-code default has a flag to restore the previous output (see the table below).
Am I affected?
quicktype-coreembedders: additionally note the Node.js ≥ 20.19 requirement, the newexportsmap (deep imports only viaquicktype-core/dist/*), typedrendererOptionskeys, and the stricterlanguageNamed().Breaking changes since 23.2.6
Runtime and packaging (introduced in 24.x)
fetchreplaces bundled fetch polyfills. If your application supplied a fetch polyfill only for quicktype, you can remove it.quicktype-coreships a dual CJS/ESM build with anexportsmap.requireresolves the CommonJS build,importresolves the ESM build. Deep imports must go throughquicktype-core/dist/*; other undeclared paths no longer resolve.languageNamed()accepts only canonical language names. Display names and file extensions (e.g."C++","kt") are no longer accepted; unknown strings returnundefinedinstead of throwing. UseisLanguageName()to validate arbitrary strings.Core API (introduced in 25.0.0)
rendererOptionskeys are type-checked in thequicktype-coreAPI. TypeScript consumers passing unknown option keys now get compile errors.Type inference (introduced in 25.0.0)
9007199254740991now becomesFloat64in Crystal instead of an overflowingInt32.Generated-code defaults (new in 26.0.0)
These change what the generated code looks like and which dependencies it needs. Each has a flag to restore the previous output.
[JsonPropertyName],#nullable enable), C# 8--framework NewtonSoft --csharp-version 6--framework klaxonstd::variant/std::optional, no Boost dependencyboost::variant/boost::optional--boostList<T>T[]arrays--array-type array@dataclass+ PEP 585 generics (list[...]) — generated code now targets Python 3.9+__init__,typing.List--python-version 3.7Encoder/Decoderderivation--just-typesCodingKeysenums--no-coding-keysfinalfields (immutable)--no-final-propsunknowninstead ofanyany--no-prefer-unions --no-prefer-unknownListArray--array-type array(0.18 no longer supported)Vector#[derive(Debug, Clone, Serialize, Deserialize)],pubfieldsSerialize/Deserializeonly, private fields--no-derive-debug --no-derive-clone --visibility privateAlso in TypeScript, JSON Schema arrays with
minItems/maxItems(and 2020-12prefixItems) now generate tuple types.Output for the remaining targets is unchanged: in our JSON-input comparison against 23.2.6, C (cJSON), Elixir, Flow, Go, JavaScript, JavaScript PropTypes, JSON Schema, Objective-C, Pike, Ruby, Smithy, TypeScript, TypeScript Effect Schema, and TypeScript Zod produced byte-identical output. (TypeScript and Flow appear in both lists because their new defaults only alter output where enums,
any, or tuple-typed arrays occur — typically with JSON Schema input.)Highlights since 23.2.6 (non-breaking)
[JsonRequired]; option to suppressDateOnly/TimeOnlyconverters.--integer-typeoption with conservativei32inference.--final-classesoption;JSONNullhash(into:)emitted by default.--prefer-unknownoption; TypeScript input now supportsDateandMap.unevaluatedPropertiessupport; JSON Schema 2020-12prefixItemstuples; Windows absolute schema paths (drive-letter and UNC) work correctly.--just-typesnow works in every language (previously crashed the option parser for C# and Kotlin); clear error for emptyaddSourcesamples; correct--helprendering for boolean flags; fixed nested intersections in union flattening; Kotlin/Klaxon map deserialization fix.Contributors
Huge thanks to everyone who contributed since 23.2.6:
@ankrgyl, @artursvonda, @AysajanE, @basdl, @cconverse711, @coyaSONG, @Flern, @h3ndrk, @HavardNJ-Laerdal, @haya14busa, @jessicamrbr, @jonashao, @k-vasily, @Leonard013, @liosha, @matthew-c-lee, @mikecrowe-otp, @mohamedelhabib, @nikhilunni, @PssbleTrngle, @Quafadas, @schani, @thives, @tolbon, @uuf6429, @vexdev, @w830207 — and dependabot for keeping dependencies current.
Full changelog: glideapps/quicktype@v25.1.0...v26.0.0 (see the v24.0.0, v25.0.0, and v25.1.0 releases for the full history since 23.2.6, which predates release tags.)
v25.1.0Compare Source
What's Changed
New Contributors
Full Changelog: glideapps/quicktype@v25.0.0...v25.1.0