Skip to content

Conversation

@lucanovera
Copy link
Contributor

@lucanovera lucanovera commented Nov 17, 2025

Ticket ENG-1990

Description Of Changes

Upgrade client projects to typescript 5. Fix issues.

Code Changes

  • Upgrade dependencies to typescript and any other strictly needed updates to upgrade typescript
  • Fix issue with headers polyfill types
  • Fix issue with consent request form
  • Removed ts expect errors
  • Add explicit skipping of TCF
  • Update pino calls to use proper order of args

Steps to Confirm

  1. CI passes
  2. Check code changes are type only or superficial, but no changes in behavior are introduced

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@lucanovera lucanovera requested a review from a team as a code owner November 17, 2025 20:52
@lucanovera lucanovera requested review from jpople and removed request for a team November 17, 2025 20:52
@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Nov 20, 2025 6:11pm
fides-privacy-center Ignored Ignored Nov 20, 2025 6:11pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 17, 2025

Greptile Summary

  • Upgrades TypeScript from 4.9.5 to 5.7.2 across all client projects (admin-ui, fides-js, fidesui, privacy-center)
  • Fixes Headers polyfill type compatibility by adding union type support and type casts for fetch operations
  • Corrects pino logger argument order (context object first, message second) throughout API files

Confidence Score: 4/5

  • This PR is generally safe to merge with one logic concern to verify in testing
  • The TypeScript upgrade and most changes are straightforward type compatibility fixes. However, there's one logic concern in the multiselect handling that should be verified through testing, and the TCF type cast should be validated to ensure no runtime errors
  • Pay close attention to clients/privacy-center/hooks/useCustomFieldsForm.ts for the multiselect logic change and clients/fides-js/src/lib/tcf.ts for the type cast

Important Files Changed

Filename Overview
clients/fides-js/src/lib/tcf.ts Added defensive handling for TCF publisher restriction type 3 and type cast for TypeScript 5 compatibility
clients/privacy-center/common/CommonHeaders.ts Added union type to support both native Headers and headers-polyfill for TypeScript 5 compatibility
clients/privacy-center/hooks/useCustomFieldsForm.ts Fixed multiselect logic issue with proper type handling and moved import to top of file

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@lucanovera lucanovera changed the title Upgrade to typescript 5 Draft: Upgrade to typescript 5 Nov 17, 2025
@lucanovera
Copy link
Contributor Author

@greptileai review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

} else if (Array.isArray(field?.default_value)) {
value = field.default_value;
} else {
value = field.default_value ?? [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: type safety issue: field.default_value is typed as string[] | null | undefined, but after checking Array.isArray on line 37, the else branch on line 40 should only handle null | undefined. However, TypeScript doesn't narrow the type, so field.default_value ?? [] could still be string[] | null | undefined, and if it's a non-null, non-undefined, non-array value (which shouldn't happen based on types but isn't guaranteed), this could cause a runtime type error where value: string[] gets assigned a non-array.

Suggested change
value = field.default_value ?? [];
} else {
value = (field.default_value as string[]) ?? [];
}

@lucanovera lucanovera changed the title Draft: Upgrade to typescript 5 Upgrade to typescript 5 Nov 18, 2025
Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Code looks clean and improved and with tests all passing it is good to go.

@lucanovera lucanovera added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 5bbd1e3 Nov 20, 2025
46 of 47 checks passed
@lucanovera lucanovera deleted the ENG-1990-Upgrade-to-typescript-5 branch November 20, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants