Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 28, 2025

This PR makes the v2 moduleMetadata code snippet ES5-compliant by replacing the Object.assign merge strategy of the module with a pure ES5 merge strategy: iterating over the object property of both objects to merge to the final object.
Obviously, this increases the bundle size footpring but I think we need to prioritize correctness.

Reviewers can check 62321e2 which shows the new merge strategy prior to minification.

I also took the opportunity to minify the code and further isolate the var-declared variables by wrapping the code in an IIFE. Adjusted to the tests to also use toMatchSnapshot, since the inline snapshots would no longer be readable. Worth noting, we also have integration tests that actually check the behaviour, so I'm confident that the minified code still works correctly.

I'll also open a similar PR to v4, since we decided to provide full ES5 compatibility again.

closes #768

@Lms24 Lms24 changed the base branch from main to v2 July 28, 2025 15:02
@Lms24 Lms24 merged commit b255ad5 into v2 Jul 29, 2025
15 checks passed
@Lms24 Lms24 deleted the lms/fix-v2-remove-object-assign branch July 29, 2025 07:40
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.

3 participants