Skip to content

Dev#174

Merged
jorgedanisc merged 2 commits intomainfrom
dev
Dec 17, 2025
Merged

Dev#174
jorgedanisc merged 2 commits intomainfrom
dev

Conversation

@jorgedanisc
Copy link
Contributor

No description provided.

jorgedanisc and others added 2 commits December 17, 2025 04:55
fix: Rename pdf2svg WASM bindings to `pdf2svg-wasm` and update build …
@jorgedanisc jorgedanisc self-assigned this Dec 17, 2025
Copilot AI review requested due to automatic review settings December 17, 2025 04:57
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 renames the WASM bindings exports from pdf2svg to pdf2svg-wasm in the distribution output to provide clearer naming for the compiled WASM module files.

  • Updates the build script to copy WASM files with -wasm suffix in the dist directory
  • Modifies import paths in wasm.ts to reference the renamed files
  • Updates Vite externalization configuration for the new naming pattern

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/ducsvg/vite.config.mts Updates external dependencies list to match renamed WASM module exports and adds regex pattern for pdf2svg-wasm files
packages/ducsvg/src/wasm.ts Updates re-export paths to reference the renamed pdf2svg-wasm files in dist
packages/ducsvg/package.json Modifies copy script to rename output files to pdf2svg-wasm.js and pdf2svg-wasm.d.ts when copying to dist

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

/\.wasm$/, // Don't bundle WASM files inline
'ducpdf',
'ducjs',
'/pdf2svg/pkg/',
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The string '/pdf2svg/pkg/' should be a regex pattern. Change it to /pdf2svg/pkg// to properly match paths containing 'pdf2svg/pkg/'.

Suggested change
'/pdf2svg/pkg/',
/pdf2svg\/pkg\//,

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +31
'ducpdf',
'ducjs',
'/pdf2svg/pkg/',
/pdf2svg-wasm(\.js)?$/,
/\.wasm$/,
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Removing the explanatory comments reduces code documentation. The previous comments explained why each dependency was externalized (e.g., "Uses Rust WASM - let consuming app handle", "Externalize pdf2svg wasm bindings to prevent inline base64 bundling"). Consider retaining these comments to help future maintainers understand the build configuration.

Suggested change
'ducpdf',
'ducjs',
'/pdf2svg/pkg/',
/pdf2svg-wasm(\.js)?$/,
/\.wasm$/,
'ducpdf', // Uses Rust/WASM runtime; let consuming app handle loading and hosting
'ducjs', // Shared runtime library; avoid bundling so consumer can manage versioning
'/pdf2svg/pkg/', // pdf2svg WASM package path; keep package layout and assets external
/pdf2svg-wasm(\.js)?$/, // pdf2svg-wasm JS loader; avoid bundling to prevent inline base64 and keep loader external
/\.wasm$/, // Externalize all WASM binaries so Vite/Rollup do not inline them; consuming app is responsible for fetching/serving WASM

Copilot uses AI. Check for mistakes.
@jorgedanisc jorgedanisc merged commit 8befa34 into main Dec 17, 2025
7 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 3.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant