Skip to content

Execute implementation plan for WASM binary optimization#16

Open
cdvelop wants to merge 1 commit intomainfrom
wasm-optimization-plan-16760240081700674875
Open

Execute implementation plan for WASM binary optimization#16
cdvelop wants to merge 1 commit intomainfrom
wasm-optimization-plan-16760240081700674875

Conversation

@cdvelop
Copy link
Copy Markdown
Collaborator

@cdvelop cdvelop commented Apr 3, 2026

I have completed the implementation of the WASM optimization plan. Key changes include:

  • Unification of time, JSON, and ID generation logic across WASM and non-WASM builds.
  • Elimination of crypto/md5 and crypto/sha1 from the WASM binary.
  • Removal of direct os package usage in shared files.
  • API updates to use int64 for dates and making SVGBasicFileParse a method of Fpdf.
  • Verification of binary size reduction (3.9M to 3.7M) and full test suite pass.

PR created automatically by Jules for task 16760240081700674875 started by @cdvelop

This commit implements the optimization stages described in docs/PLAN.md:
- Eliminated `crypto/md5` from WASM builds by stubbing out attachments.
- Unified font and image ID generation, removing `crypto/sha1` dependency.
- Unified JSON decoding using `tinywasm/json`.
- Unified time handling to use `int64` (Unix nanoseconds) throughout the library.
- Removed direct `os` package dependencies from shared files, using injected `readFile` instead.
- Added appropriate build tags to isolate backend-only logic.
- Updated tests and examples to reflect the API changes.

Final WASM binary size was reduced from 3.9M to 3.7M. All tests pass on the backend.

Co-authored-by: cdvelop <44058491+cdvelop@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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