Update XML reader for quick-xml 0.41 and clean code warnings#894
Open
Sachin-Bhat wants to merge 10 commits into
Open
Update XML reader for quick-xml 0.41 and clean code warnings#894Sachin-Bhat wants to merge 10 commits into
Sachin-Bhat wants to merge 10 commits into
Conversation
Update the workspace dependency set and adapt the XML reader for the quick-xml 0.40 API. Handle GeneralRef events, use normalized attribute decoding, rename EventReader::next to next_event, refresh generated TS bindings for ts-rs 12, and update benches for criterion 0.8. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Box the large Paragraph, Table, and Run enum variants to satisfy clippy::large_enum_variant. Preserve builder-style APIs by boxing internally, and update the wasm table-cell wrapper for the new variant payloads. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Apply mechanical clippy fixes across document elements and document metadata code. This removes needless borrows, redundant formatting, needless lifetimes, manual ok conversions, single-character push_str calls, and collapsible matches. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Derive default enum implementations where possible, simplify XML builder and writer formatting, remove needless question-mark/update patterns, and replace checked unwraps in XML JSON name formatting with explicit Option matching. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
- Bump actions/checkout v4 -> v7, actions/setup-node v4 -> v6, actions/cache v4 -> v6 across all jobs - Switch node-version from pinned 20 to 'node' (latest) - Replace manual wasm-pack/target add installs with moonrepo targets/bins inputs and GITHUB_TOKEN env, and use corepack to manage pnpm - Split wasm build into discrete steps for clearer CI logs - Strip trailing whitespace and normalize working-directory indent Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Updates quick-xml in docx-core and regenerates the lockfile, pulling in transitive upgrades (autocfg, bytemuck, cc, clap, etc.) and removing the now-unused bitflags 1.x entry. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Tidy {:?} -> {res:?} at docx-wasm/src/doc.rs:216.
Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Refreshes docx-wasm/js/json/bindings/* from the latest ts-bindgen output to match the updated Rust schemas: nullable fields are now typed as 'T | null' (previously 'T?'), optional fields on the generated interfaces are now explicitly nullable, and a few type aliases (e.g. AlignmentType) were reformatted. No runtime change. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
Expands the regenerated FrameProperty, Pic, and TablePositionProperty TypeScript bindings with JSDoc copied from the OOXML/ECMA-376 schema descriptions for each property, and converts the optional interfaces to nullable 'T | null' types to align with the rest of the bindings. Includes a reference URL on TablePositionProperty for the underlying schema. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
The generated _pageTypeNum payload now explicitly sets start and chapStyle to null when callers pass undefined, matching the nullable shape produced by the JSON bindings and avoiding 'undefined' entries in the serialized object. Signed-off-by: Sachin Bhat <sachubhat17@gmail.com>
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.
What does this change?
Updates the workspace for newer dependency and clippy compatibility.
Primary motivation:
quick-xmlversions before0.41have known security advisories affecting downstream consumers, so this PR moves the workspace off the vulnerable range. As a side effect it picks up the API changes between the old version and0.41.quick-xml0.41(from the previously vulnerable0.40and earlier) indocx-core, and regeneratesCargo.lock. This requires the0.40migration below as a stepping stone.GeneralRefevents, normalized attribute decoding, and broader entity-decoding coverage.EventReader::next()toEventReader::next_event()to match the new API.CommentChild,DeleteChild, andTableCellContentto satisfyclippy::large_enum_variant, with matchingdocx-wasmupdates. This is a breaking change for any consumer constructing these enums directly (use the builder APIs instead).ts-rsoutput format (nullableT | nullfields, JSDoc onFrameProperty/Pic/TablePositionProperty,TablePositionPropertyschema link).actions/checkouttov7,actions/setup-nodetov6,actions/cachetov6; switches the Node version tonode; replaces manualwasm-pack/ target installs withmoonrepo/setup-rusttargets/binsinputs pluscorepackfor pnpm.References
quick-xmlsecurity advisories for< 0.41(RUSTSEC) — see the quick-xml changelog / advisory page for affected CVE IDs and fixed-in version.Screenshots
Not applicable. This is a Rust library/workspace change.
What can I check for bug fixes?
Run:
cargo +nightly clippy --workspace --all-targets --all-features --locked -- -D warnings -W clippy::perf cargo +nightly test --workspace --all-features --locked --libExpected result: clippy completes with no warnings, and the workspace lib tests pass. The XML entity regression is covered by
reader::xml_parser::tests::decodes_xml_entities_in_text_and_attributes.Also verify the
quick-xmlversion indocx-core/Cargo.tomlresolves to0.41.xviacargo tree -p docx-core | grep quick-xml.