Skip to content

[Main] Merge 1ds-core-js into applicationinsights-core-ts#2712

Merged
MSNev merged 5 commits intomainfrom
MSNev/Merge1DS
Mar 4, 2026
Merged

[Main] Merge 1ds-core-js into applicationinsights-core-ts#2712
MSNev merged 5 commits intomainfrom
MSNev/Merge1DS

Conversation

@MSNev
Copy link
Collaborator

@MSNev MSNev commented Mar 3, 2026

No description provided.

@MSNev MSNev requested a review from a team as a code owner March 3, 2026 22:22
Copilot AI review requested due to automatic review settings March 3, 2026 22:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR merges the legacy @microsoft/1ds-core-js implementation into shared/AppInsightsCore (@microsoft/applicationinsights-core-js), consolidating 1DS (OneCollector) core types/utilities into the main core package while keeping shared/1ds-core-js as a backward-compat re-export layer.

Changes:

  • Move / re-home 1DS enums, data models, utilities, and AppInsightsExtCore into shared/AppInsightsCore/src and export them from shared/AppInsightsCore/src/index.ts.
  • Update 1ds-post-js to depend on @microsoft/applicationinsights-core-js (instead of @microsoft/1ds-core-js) and adjust imports/tests accordingly.
  • Remove/trim legacy shared/1ds-core-js source/test implementations and shift relevant tests into shared/AppInsightsCore test suite.

Reviewed changes

Copilot reviewed 47 out of 48 changed files in this pull request and generated no comments.

Show a summary per file
File Description
shared/AppInsightsCore/src/utils/HelperFuncs.ts Switches TransportType import to the merged 1DS enum location.
shared/AppInsightsCore/src/interfaces/ext/DataModels.ts Re-points 1DS data model imports to local core interfaces/enums.
shared/AppInsightsCore/src/interfaces/ai/ISenderPostManager.ts Switches TransportType import to merged 1DS enum location.
shared/AppInsightsCore/src/index.ts Adds 1DS exports (enums, data models, classes, utils, span utils) and adjusts existing exports.
shared/AppInsightsCore/src/ext/extUtils.ts Migrates utility imports to local core structure; adjusts constants and type detection.
shared/AppInsightsCore/src/ext/extSpanUtils.ts Migrates span utility imports off package self-import to local module paths.
shared/AppInsightsCore/src/ext/ValueSanitizer.ts Migrates sanitizer imports to local core structure and ext utils.
shared/AppInsightsCore/src/ext/AppInsightsExtCore.ts Introduces AppInsightsExtCore derived from core AppInsightsCore using dynamicProto.
shared/AppInsightsCore/src/enums/ext/Enums.ts Moves ext enums off package self-import; removes EventPersistence* from ext enums.
shared/AppInsightsCore/src/enums/ai/SendRequestReason.ts Removes TransportType from ai enums (now provided via ext enums).
shared/AppInsightsCore/src/enums/ai/Enums.ts Adds/updates EventPersistenceValue docs/exports for consolidated usage.
shared/AppInsightsCore/src/core/SenderPostManager.ts Switches TransportType import to ext enums.
shared/AppInsightsCore/src/constants/InternalConstants.ts Adds 1DS-related internal constants (endpoint URL, version key, not specified).
shared/AppInsightsCore/Tests/Unit/src/ext/ValueSanitizerTests.ts Updates imports to new core locations; aligns persistence enum usage.
shared/AppInsightsCore/Tests/Unit/src/ext/UtilsTest.ts Updates imports to new core locations.
shared/AppInsightsCore/Tests/Unit/src/ext/TestHelper.ts Updates imports to new core locations.
shared/AppInsightsCore/Tests/Unit/src/ext/SpanUtilsTests.ts Updates imports to new core locations.
shared/AppInsightsCore/Tests/Unit/src/ext/GlobalTestHooks.Test.ts Updates imports to new core locations.
shared/AppInsightsCore/Tests/Unit/src/ext/ESPromiseTests.ts Adds migrated 1DS async-promise unit tests to core test suite.
shared/AppInsightsCore/Tests/Unit/src/ext/ESPromiseSchedulerTests.ts Updates imports to new core locations; removes sinon import usage.
shared/AppInsightsCore/Tests/Unit/src/ext/DynamicProtoTests.ts Removes sinon import (test framework clock/sandbox expected to be used).
shared/AppInsightsCore/Tests/Unit/src/ext/CoreTest.ts Updates to AppInsightsExtCore naming and consolidated index imports.
shared/AppInsightsCore/Tests/Unit/src/aiunittests.ts Registers the migrated 1DS test classes in the core unit test runner.
shared/AppInsightsCore/Tests/Unit/src/ai/AppInsightsCoreSize.Tests.ts Updates size thresholds to reflect added exports/merged functionality.
shared/1ds-core-js/test/UnitTests.html Adjusts unit test module registration name for the legacy package.
shared/1ds-core-js/test/Unit/src/core.unittests.ts Removes most tests from legacy package runner (now hosted in AppInsightsCore tests).
shared/1ds-core-js/test/Unit/src/ESPromiseTests.ts Deletes legacy copy of ESPromise tests (migrated to AppInsightsCore).
shared/1ds-core-js/src/InternalConstants.ts Deletes legacy internal constants (now in AppInsightsCore internal constants).
shared/1ds-core-js/src/Index.ts Converts 1ds-core-js to a backward-compat re-export facade over applicationinsights-core-js.
shared/1ds-core-js/src/BaseCore.ts Deletes legacy BaseCore implementation (superseded by merged core/ext core).
rush.json Bumps Rush-managed npm version.
extensions/applicationinsights-clickanalytics-js/src/common/Utils.ts Removes now-redundant extended internal message id typedefs/enums from clickanalytics utils.
common/config/rush/npm-shrinkwrap.json Updates shrinkwrap for tooling/dependency changes (incl. Rush/npm bump).
channels/1ds-post-js/test/Unit/src/TestHelper.ts Switches 1DS type import to applicationinsights-core-js.
channels/1ds-post-js/test/Unit/src/SerializerTest.ts Switches imports to consolidated core package; adjusts local channel imports.
channels/1ds-post-js/test/Unit/src/PostChannelTest.ts Switches to consolidated core package and AppInsightsExtCore.
channels/1ds-post-js/test/Unit/src/HttpManagerTest.ts Switches to consolidated core package and AppInsightsExtCore; adjusts types.
channels/1ds-post-js/test/Unit/src/GlobalTestHooks.Test.ts Switches test-hook import to consolidated core package.
channels/1ds-post-js/src/Serializer.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/PostChannel.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/KillSwitch.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/Index.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/HttpManager.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/EventBatch.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/DataModels.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/src/BatchNotificationActions.ts Switches core imports from 1ds-core-js to applicationinsights-core-js.
channels/1ds-post-js/package.json Replaces dependency on @microsoft/1ds-core-js with @microsoft/applicationinsights-core-js.
.aiAutoMinify.json Updates const-enum lists to reflect merged 1DS enums and removes legacy 1ds-core/clickanalytics enums.
Files not reviewed (1)
  • common/config/rush/npm-shrinkwrap.json: Language not supported
Comments suppressed due to low confidence (2)

shared/AppInsightsCore/src/ext/extUtils.ts:46

  • The PURE annotation is written as /* #__PURE__*/ (with a space). Most bundlers/minifiers only recognize the exact /*#__PURE__*/ token, so this likely won’t be honored and defeats the intended tree-shaking/minification hint. Consider changing to the standard token (or removing it if it’s not needed).
    shared/AppInsightsCore/src/ext/AppInsightsExtCore.ts:55
  • The doPerf event names still use "AppInsightsCore.*" even though this class is now AppInsightsExtCore. This makes perf/event attribution ambiguous when troubleshooting. Consider updating the names to "AppInsightsExtCore.initialize" / "AppInsightsExtCore.track" (or another consistent naming convention).

@MSNev MSNev merged commit 2a15b82 into main Mar 4, 2026
9 checks passed
@MSNev MSNev deleted the MSNev/Merge1DS branch March 4, 2026 19:38
MSNev added a commit that referenced this pull request Mar 6, 2026
* [Main] Merge 1ds-core-js into applicationinsights-core-js
Phase 1: Move files to keep history

* Phase 2: Update imports, fix compile issues and delete unused

* Phase 3: Move a few more files around

* Phase 4: adjust imports from Phase 3

* Phase 5: Update 1ds-core-js README.md
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