Skip to content

♻️ replace time imports from browser-core with js-core/time#138

Merged
bcaudan merged 2 commits into
mainfrom
worktree-refactor+replace-time-imports-with-js-core
Jun 18, 2026
Merged

♻️ replace time imports from browser-core with js-core/time#138
bcaudan merged 2 commits into
mainfrom
worktree-refactor+replace-time-imports-with-js-core

Conversation

@thomas-lebeau

Copy link
Copy Markdown
Contributor

Motivation

Reduce dependency on @datadog/browser-core by migrating time-related imports (timeStampNow, dateNow, elapsed, ONE_SECOND, ONE_MINUTE, ONE_HOUR, toServerDuration) to @datadog/js-core/time, the canonical package for these utilities.

Changes

  • Replace time-related imports in src/ files from @datadog/browser-core to @datadog/js-core/time:
    • Assembly.ts, config.ts, OperationCollection.ts, ViewCollection.ts, ViewContext.ts, SessionContext.ts, SessionManager.ts, session.constants.ts, BatchProducer.ts
  • Update BatchProducer.spec.ts to mock @datadog/js-core/time instead of @datadog/browser-core

Test instructions

  • Run the existing unit tests: yarn test

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated related documentation.

- Replace timeStampNow, elapsed, ONE_SECOND, ONE_MINUTE, ONE_HOUR, toServerDuration
  imports from @datadog/browser-core with @datadog/js-core/time
- Bump @datadog/js-core from 0.0.1 to 0.0.3
- Move `TimeStamp` type imports from `@datadog/browser-core` to `@datadog/js-core/time`
  across all source and spec files
@thomas-lebeau thomas-lebeau marked this pull request as ready for review June 17, 2026 13:42
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner June 17, 2026 13:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87a4bceff4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/assembly/Assembly.ts
@bcaudan bcaudan merged commit 1a966de into main Jun 18, 2026
15 checks passed
@bcaudan bcaudan deleted the worktree-refactor+replace-time-imports-with-js-core branch June 18, 2026 07:39
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