BREAKING(xml): clean up public API ahead of stabilization#7206
Open
tomas-zijdemans wants to merge 3 commits into
Open
BREAKING(xml): clean up public API ahead of stabilization#7206tomas-zijdemans wants to merge 3 commits into
tomas-zijdemans wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7206 +/- ##
=======================================
Coverage 94.83% 94.84%
=======================================
Files 617 618 +1
Lines 51674 51680 +6
Branches 9350 9351 +1
=======================================
+ Hits 49007 49015 +8
Misses 2121 2121
+ Partials 546 544 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleanup of the
@std/xmlpublic API in preparation for a futurestabilization proposal. The goal is to remove surface that should not be
stabilized and fix documentation that did not match actual behavior, so
the API that remains is the API we would commit to at 1.0.0.
Breaking changes
XmlEventunion and its eventinterfaces (
XmlStartElementEvent,XmlEndElementEvent,XmlTextEvent,XmlCDataEvent,XmlCommentEvent,XmlProcessingInstructionEvent) andXmlAttributewere leftovers from a pre-callback event-object design andappeared in no public function signature.
XmlTokenCallbacksis thetokenizer's internal contract and has moved to
_tokenizer.ts.XmlDeclarationEventtoXmlDeclaration. It survives only as thetype of
XmlDocument.declaration, so theEventsuffix was a misnomer.XmlSyntaxErrorno longer appendsat line 0, column 0to messageswhen position tracking is disabled.
line: 0is documented as thesentinel for "position unknown".
Documentation fixes
XmlPosition.offsetandXmlSyntaxError.offsetare UTF-16 code-unitoffsets into the input string, not byte offsets.
XmlElement.attributesis keyed by the raw qualified attribute name(e.g.
xlink:href,xmlns:ns), not the local name.XmlEventCallbacks.onDoctypenow documents that it only fires whendisallowDoctype: falseis set; under the default, a DOCTYPE throws.Tests
parseXmlStream()DOCTYPE tests:onDoctypereceives name,public ID, and system ID; the default rejects DOCTYPE without invoking
the callback (previously only covered at the internal tokenizer level).
XmlSyntaxError.Test plan
deno task okpasses locallyThis PR was developed with the assistance of an AI agent in Cursor; all
changes were reviewed and verified by me.