fix(@angular/common): httpRequests and httpResources disabled by default since v0.90#3678
Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7ad5a2c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
de76132 to
7ad5a2c
Compare
|
Reviewed PR #3678 and approved. The fix correctly separates the Task list (6/6 completed)
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/spec-types
@hey-api/types
@hey-api/vite-plugin
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3678 +/- ##
==========================================
+ Coverage 38.31% 39.39% +1.08%
==========================================
Files 520 520
Lines 19275 19279 +4
Branches 5712 5708 -4
==========================================
+ Hits 7385 7595 +210
+ Misses 9617 9445 -172
+ Partials 2273 2239 -34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Fix is correct and minimal. The old typeof input === 'boolean' || !input condition conflated false and undefined, causing Boolean(undefined) to silently disable both features. Splitting into separate branches lets undefined pass an empty object to valueToObject, which correctly applies defaultValue.enabled: true. Verified no similar buggy patterns exist elsewhere in the plugin configs. Snapshots are structurally sound across all three spec versions.

Closes #3550
Since v0.90, adding
@angular/commonto the plugin list generates nothing — bothhttpRequestsandhttpResourcessilently default to disabled. Additionally, explicitly settinghttpResources: 'flat'crashes withError: Symbol is not resolved to a nodebecause the resource implementation references request symbols that don't exist whenhttpRequestsis disabled.Root cause
In
resolveHttpRequestsandresolveHttpResources,undefinedinput (user omitted the option) falls into the!inputbranch and resolves to{ enabled: false }, overridingdefaultValue.enabled: true:Fix
Separate the
undefinedcase so it passes an empty object and letscontext.valueToObjectapply all defaults:This also resolves the
httpResources: 'flat'crash: whenhttpRequestsis not specified it now defaults to enabled, providing the request symbols thathttpResourcesdepends on.Changes
httpRequests/config.ts— fixundefinedinput treated asfalsehttpResources/config.ts— same fix@angular/common.gen.tsoutput for thedefaultscenario across all three OpenAPI versions (2.0.x, 3.0.x, 3.1.x)