[Main] Merge 1ds-core-js into applicationinsights-core-ts#2712
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
AppInsightsExtCoreintoshared/AppInsightsCore/srcand export them fromshared/AppInsightsCore/src/index.ts. - Update
1ds-post-jsto depend on@microsoft/applicationinsights-core-js(instead of@microsoft/1ds-core-js) and adjust imports/tests accordingly. - Remove/trim legacy
shared/1ds-core-jssource/test implementations and shift relevant tests intoshared/AppInsightsCoretest 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).
JacksonWeber
approved these changes
Mar 4, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.