Skip to content

swap XML library#1539

Merged
paustint merged 1 commit intomainfrom
chore/swap-xml-lib
Feb 17, 2026
Merged

swap XML library#1539
paustint merged 1 commit intomainfrom
chore/swap-xml-lib

Conversation

@paustint
Copy link
Contributor

@paustint paustint commented Feb 12, 2026

xmlbuilder2 no longer works in browsers with their latest update which prompted this change

the new XML parser is usable in browser environments with one 1 dependency
and was already a transient dependency

Base automatically changed from chore/upgrade-deps-02-11-2026 to main February 12, 2026 16:03
@socket-security
Copy link

socket-security bot commented Feb 12, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedreact@​19.2.01001008497100
Addedprism-react-renderer@​2.4.19910010086100
Addedtypescript@​5.9.31001009010090
Addedreact-dom@​19.2.01001009298100

View full report

@socket-security
Copy link

socket-security bot commented Feb 12, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@paustint paustint force-pushed the chore/swap-xml-lib branch 2 times, most recently from 65ab012 to 1cbbd40 Compare February 13, 2026 05:02
@paustint paustint changed the title chore: wip - swap XML library swap XML library Feb 13, 2026
@paustint paustint marked this pull request as ready for review February 13, 2026 05:03
Copilot AI review requested due to automatic review settings February 13, 2026 05:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the XML-to-object parsing approach used by the Salesforce API client to restore browser compatibility after xmlbuilder2’s browser parsing regressions, by introducing fast-xml-parser and normalizing SOAP/XML response shapes.

Changes:

  • Add fast-xml-parser and update XML parsing in callout-adapter to return namespace-stripped object shapes (Envelope/Body/Header).
  • Update Salesforce SOAP response typings/usages to align with the new parsed structure (e.g., Envelope instead of ns1:Envelope / soapenv:Envelope).
  • Add/expand Vitest coverage around SOAP/XML parsing for callouts, Metadata API, and Bulk API.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
yarn.lock Locks new/updated dependency graph for fast-xml-parser + xmlbuilder2 updates.
package.json Adds fast-xml-parser dependency and bumps xmlbuilder2.
libs/types/src/lib/salesforce/apex.types.ts Updates SOAP envelope typing keys to match namespace-stripped parsing.
libs/shared/utils/src/lib/utils.ts Broadens getValueOrSoapNull return type to include parsed booleans/numbers.
libs/salesforce-api/src/lib/types.ts Updates shared SOAP response types to use Envelope key.
libs/salesforce-api/src/lib/callout-adapter.ts Replaces xmlbuilder2 parsing with fast-xml-parser and adds parseXml().
libs/salesforce-api/src/lib/api-metadata.ts Updates SOAP response access paths for metadata calls to Envelope.
libs/salesforce-api/src/lib/api-apex.ts Updates SOAP response access paths for Apex calls to Envelope.
libs/salesforce-api/src/lib/tests/callout-adapter.spec.ts Adds tests validating SOAP/XML parsing behavior and error extraction.
libs/salesforce-api/src/lib/tests/api-metadata.spec.ts Adds tests validating metadata SOAP parsing + type normalization.
libs/salesforce-api/src/lib/tests/api-bulk.spec.ts Adds tests validating bulk XML parsing + numeric conversions.
Comments suppressed due to low confidence (1)

libs/types/src/lib/salesforce/apex.types.ts:16

  • These SOAP response field unions use SoapNil, but SoapNil is currently modeled as { $: { 'xsi:nil': 'true' } } while the new fast-xml-parser based parsing appears to yield attribute-driven shapes (e.g. { '@xsi:nil': 'true' }). Consider updating SoapNil (or widening these unions) so types match the parsed runtime shape.
        result: {
          column: string | SoapNil;
          compileProblem: string | SoapNil;
          compiled: string | SoapNil;
          exceptionMessage: string | SoapNil;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paustint paustint force-pushed the chore/swap-xml-lib branch 2 times, most recently from 099e4b3 to 858ef1a Compare February 17, 2026 03:25
xmlbuilder2 no longer works in browsers with their latest update which prompted this change

the new XML parser is usable in browser environments with one 1 dependency
which was already a transient dependency

Replaced parsing and serialization with fast-xml-parser
@paustint paustint merged commit b1d8317 into main Feb 17, 2026
9 checks passed
@paustint paustint deleted the chore/swap-xml-lib branch February 17, 2026 04:18
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.

1 participant

Comments