Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Jan 14, 2025

This PR vendors tracekit to alleviate some issues with ESM compatibility.
Currently the typescript conversion is minimal. It adds the types which are largely compatible and leaves most of it reasonably unchanged.

This PR does not port the tests from tracekit to this repository. A subsequent PR will do this.

BEGIN_COMMIT_OVERRIDE
feat: Vendor TraceKit
feat: Export browser-telemetry initialization method.
END_COMMIT_OVERRIDE

Jira: EMSR-14
Jira: EMSR-15

@kinyoklion kinyoklion requested a review from a team as a code owner January 14, 2025 18:03
@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Size: 19014 bytes
Size limit: 21000

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Size: 15354 bytes
Size limit: 20000

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Size: 19814 bytes
Size limit: 21000

Copy link
Member Author

Choose a reason for hiding this comment

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

Aside from type annotations the only functional changes in this file are additional conversion checks to match the expected types in the original code.

Additionally the module support has been removed, and assigning to window has been removed, and a function was added to get the tracekit instance versus exporting it.

The problem with modules was that they are imported immutably, so we could not do things like adjust the context lines which required assignment to an import.

@kinyoklion kinyoklion merged commit d1b364e into main Jan 14, 2025
23 checks passed
@kinyoklion kinyoklion deleted the rlamb/emsr-14/export-initialization-method branch January 14, 2025 22:28
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