Add polyfills for Undici and Canvas compatibility#36
Conversation
- Added TextEncoder/TextDecoder and Blob.prototype.arrayBuffer polyfills in `src/polyfills/undici.ts` using dynamic require to avoid issues in some test environments. - Added `setTimeout(...).refresh()` polyfill. - Added `ensureCanvasPolyfills` in `src/polyfills/canvas.ts` to patch `@napi-rs/canvas` instances with `addEventListener` and `removeEventListener` no-ops, ensuring Leaflet can interact with them safely. - Applied canvas polyfills in `src/index.ts` initialization. - Added `tests/polyfills.test.ts` to verify these polyfills. - Skipped `L.DomEvent` patch as it caused instability in existing tests.
|
👋 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 For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Implemented polyfills for TextEncoder, TextDecoder, Blob.prototype.arrayBuffer, setTimeout.refresh, and Canvas event listeners to improve compatibility with Undici and Leaflet in Node.js/JSDOM environments. Verified with new and existing tests.
PR created automatically by Jules for task 17702599654667614791 started by @jburnhams