Move ActivityCollector from packages/core to packages/browser#1474
Merged
carterworks merged 17 commits intomainfrom Apr 2, 2026
Merged
Move ActivityCollector from packages/core to packages/browser#1474carterworks merged 17 commits intomainfrom
carterworks merged 17 commits intomainfrom
Conversation
Structural assertions describing the desired end state of moving ActivityCollector from core to browser package. All 6 migration tests fail initially (TDD red phase). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These tree-shakable barrel exports allow ActivityCollector (and future browser-package components) to import core utilities via package specifiers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- componentCreators.js: browser component registry (activityCollector) - allOptionalComponents.js: combined re-exports from core + browser - componentMetadata.js: combined metadata for the build CLI These files won't resolve yet since ActivityCollector hasn't moved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- git mv ActivityCollector source tree to packages/browser/src/components/ - Update imports to use @adobe/alloy-core/utils and /utils/validation - Inline CLICK_ACTIVITY_DATA constant (only used by ActivityCollector) - Remove activityCollector from core componentCreators.js - Delete now-unused sessionDataKeys.js - Update build system: standalone.js, index.js, entryPointGenerator, and alloyBuilder all source components through allOptionalComponents.js - Add componentMetadata.js to browser package.json files array Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- git mv test tree from core to browser - Inline CLICK_ACTIVITY_DATA constant in createClickActivityStorage.spec.js - Fix createEvent cross-package import path - Expand vitest unit test include to packages/*/test/unit/** - Add packages/browser/src/** to coverage include Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Copy flushPromiseChains and testConfigValidators helpers to browser test tree (shared by ActivityCollector tests) - Fix createEvent import to use correct relative path through packages/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add packages/browser/src/input.js to .gitignore (build artifact) - Replace dynamic import in validation test with static file reads - Fix createEvent import path in moved test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add createEvent.js helper that re-exports from core via relative path, avoiding Vite browser mode resolution issues with unexported subpaths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
clickHandler() returns a promise that resolves after the full .then()/.catch() chain — no need for the microtask-flushing hack. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update vitest, @vitest/browser-playwright, and @vitest/coverage-v8 from ^4.0.16 to ^4.1.2. Refactor componentMigration.spec.js to use vitest 4.1 builder pattern fixtures with onCleanup, async buildAndRead with AbortSignal support, and os.tmpdir for build output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move scripts/specs/componentMigration.spec.js to scripts/customBuild.spec.js. Add defaultBundle fixture derived from buildAlloy, use memoized build with cache-busting tmpdir, and add bundle size comparison assertion for exclusion test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jonsnyder
approved these changes
Apr 2, 2026
4 tasks
carterworks
added a commit
that referenced
this pull request
Apr 6, 2026
* test: add RED validation tests for ActivityCollector migration Structural assertions describing the desired end state of moving ActivityCollector from core to browser package. All 6 migration tests fail initially (TDD red phase). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add ./utils and ./utils/validation subpath exports to core These tree-shakable barrel exports allow ActivityCollector (and future browser-package components) to import core utilities via package specifiers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: create browser component infrastructure - componentCreators.js: browser component registry (activityCollector) - allOptionalComponents.js: combined re-exports from core + browser - componentMetadata.js: combined metadata for the build CLI These files won't resolve yet since ActivityCollector hasn't moved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: move ActivityCollector from core to browser package - git mv ActivityCollector source tree to packages/browser/src/components/ - Update imports to use @adobe/alloy-core/utils and /utils/validation - Inline CLICK_ACTIVITY_DATA constant (only used by ActivityCollector) - Remove activityCollector from core componentCreators.js - Delete now-unused sessionDataKeys.js - Update build system: standalone.js, index.js, entryPointGenerator, and alloyBuilder all source components through allOptionalComponents.js - Add componentMetadata.js to browser package.json files array Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: move ActivityCollector tests to browser package - git mv test tree from core to browser - Inline CLICK_ACTIVITY_DATA constant in createClickActivityStorage.spec.js - Fix createEvent cross-package import path - Expand vitest unit test include to packages/*/test/unit/** - Add packages/browser/src/** to coverage include Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve test helper and cross-package import paths - Copy flushPromiseChains and testConfigValidators helpers to browser test tree (shared by ActivityCollector tests) - Fix createEvent import to use correct relative path through packages/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: fix lint, gitignore build artifact, and test import paths - Add packages/browser/src/input.js to .gitignore (build artifact) - Replace dynamic import in validation test with static file reads - Fix createEvent import path in moved test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve createEvent cross-package import for browser tests Add createEvent.js helper that re-exports from core via relative path, avoiding Vite browser mode resolution issues with unexported subpaths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: increase custom build migration test timeouts * test: replace flushPromiseChains with async/await clickHandler() returns a promise that resolves after the full .then()/.catch() chain — no need for the microtask-flushing hack. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove unnecessary comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: upgrade vitest to 4.1.2 and refactor custom build tests Update vitest, @vitest/browser-playwright, and @vitest/coverage-v8 from ^4.0.16 to ^4.1.2. Refactor componentMigration.spec.js to use vitest 4.1 builder pattern fixtures with onCleanup, async buildAndRead with AbortSignal support, and os.tmpdir for build output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: rename and reorganize custom build test Move scripts/specs/componentMigration.spec.js to scripts/customBuild.spec.js. Add defaultBundle fixture derived from buildAlloy, use memoized build with cache-busting tmpdir, and add bundle size comparison assertion for exclusion test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Adjust timeout for all custom build tests * test: add minified bundle test to custom build spec Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Use fs.mkdtempSync * Add temporary tests for extension custom and standalone builds --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
carterworks
added a commit
that referenced
this pull request
Apr 6, 2026
* test: add RED validation tests for ActivityCollector migration Structural assertions describing the desired end state of moving ActivityCollector from core to browser package. All 6 migration tests fail initially (TDD red phase). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add ./utils and ./utils/validation subpath exports to core These tree-shakable barrel exports allow ActivityCollector (and future browser-package components) to import core utilities via package specifiers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: create browser component infrastructure - componentCreators.js: browser component registry (activityCollector) - allOptionalComponents.js: combined re-exports from core + browser - componentMetadata.js: combined metadata for the build CLI These files won't resolve yet since ActivityCollector hasn't moved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: move ActivityCollector from core to browser package - git mv ActivityCollector source tree to packages/browser/src/components/ - Update imports to use @adobe/alloy-core/utils and /utils/validation - Inline CLICK_ACTIVITY_DATA constant (only used by ActivityCollector) - Remove activityCollector from core componentCreators.js - Delete now-unused sessionDataKeys.js - Update build system: standalone.js, index.js, entryPointGenerator, and alloyBuilder all source components through allOptionalComponents.js - Add componentMetadata.js to browser package.json files array Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: move ActivityCollector tests to browser package - git mv test tree from core to browser - Inline CLICK_ACTIVITY_DATA constant in createClickActivityStorage.spec.js - Fix createEvent cross-package import path - Expand vitest unit test include to packages/*/test/unit/** - Add packages/browser/src/** to coverage include Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve test helper and cross-package import paths - Copy flushPromiseChains and testConfigValidators helpers to browser test tree (shared by ActivityCollector tests) - Fix createEvent import to use correct relative path through packages/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: fix lint, gitignore build artifact, and test import paths - Add packages/browser/src/input.js to .gitignore (build artifact) - Replace dynamic import in validation test with static file reads - Fix createEvent import path in moved test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve createEvent cross-package import for browser tests Add createEvent.js helper that re-exports from core via relative path, avoiding Vite browser mode resolution issues with unexported subpaths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: increase custom build migration test timeouts * test: replace flushPromiseChains with async/await clickHandler() returns a promise that resolves after the full .then()/.catch() chain — no need for the microtask-flushing hack. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove unnecessary comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: upgrade vitest to 4.1.2 and refactor custom build tests Update vitest, @vitest/browser-playwright, and @vitest/coverage-v8 from ^4.0.16 to ^4.1.2. Refactor componentMigration.spec.js to use vitest 4.1 builder pattern fixtures with onCleanup, async buildAndRead with AbortSignal support, and os.tmpdir for build output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: rename and reorganize custom build test Move scripts/specs/componentMigration.spec.js to scripts/customBuild.spec.js. Add defaultBundle fixture derived from buildAlloy, use memoized build with cache-busting tmpdir, and add bundle size comparison assertion for exclusion test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Adjust timeout for all custom build tests * test: add minified bundle test to custom build spec Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Use fs.mkdtempSync * Add temporary tests for extension custom and standalone builds --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
carterworks
added a commit
that referenced
this pull request
Apr 10, 2026
* Move ActivityCollector from packages/core to packages/browser (#1474) * test: add RED validation tests for ActivityCollector migration Structural assertions describing the desired end state of moving ActivityCollector from core to browser package. All 6 migration tests fail initially (TDD red phase). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add ./utils and ./utils/validation subpath exports to core These tree-shakable barrel exports allow ActivityCollector (and future browser-package components) to import core utilities via package specifiers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: create browser component infrastructure - componentCreators.js: browser component registry (activityCollector) - allOptionalComponents.js: combined re-exports from core + browser - componentMetadata.js: combined metadata for the build CLI These files won't resolve yet since ActivityCollector hasn't moved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: move ActivityCollector from core to browser package - git mv ActivityCollector source tree to packages/browser/src/components/ - Update imports to use @adobe/alloy-core/utils and /utils/validation - Inline CLICK_ACTIVITY_DATA constant (only used by ActivityCollector) - Remove activityCollector from core componentCreators.js - Delete now-unused sessionDataKeys.js - Update build system: standalone.js, index.js, entryPointGenerator, and alloyBuilder all source components through allOptionalComponents.js - Add componentMetadata.js to browser package.json files array Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: move ActivityCollector tests to browser package - git mv test tree from core to browser - Inline CLICK_ACTIVITY_DATA constant in createClickActivityStorage.spec.js - Fix createEvent cross-package import path - Expand vitest unit test include to packages/*/test/unit/** - Add packages/browser/src/** to coverage include Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve test helper and cross-package import paths - Copy flushPromiseChains and testConfigValidators helpers to browser test tree (shared by ActivityCollector tests) - Fix createEvent import to use correct relative path through packages/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: fix lint, gitignore build artifact, and test import paths - Add packages/browser/src/input.js to .gitignore (build artifact) - Replace dynamic import in validation test with static file reads - Fix createEvent import path in moved test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve createEvent cross-package import for browser tests Add createEvent.js helper that re-exports from core via relative path, avoiding Vite browser mode resolution issues with unexported subpaths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: increase custom build migration test timeouts * test: replace flushPromiseChains with async/await clickHandler() returns a promise that resolves after the full .then()/.catch() chain — no need for the microtask-flushing hack. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove unnecessary comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: upgrade vitest to 4.1.2 and refactor custom build tests Update vitest, @vitest/browser-playwright, and @vitest/coverage-v8 from ^4.0.16 to ^4.1.2. Refactor componentMigration.spec.js to use vitest 4.1 builder pattern fixtures with onCleanup, async buildAndRead with AbortSignal support, and os.tmpdir for build output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: rename and reorganize custom build test Move scripts/specs/componentMigration.spec.js to scripts/customBuild.spec.js. Add defaultBundle fixture derived from buildAlloy, use memoized build with cache-busting tmpdir, and add bundle size comparison assertion for exclusion test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Adjust timeout for all custom build tests * test: add minified bundle test to custom build spec Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Use fs.mkdtempSync * Add temporary tests for extension custom and standalone builds --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add step to initialize nodejs sdk --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Description
ActivityCollectoris for automatic click tracking. That doesn't make sense outside of a browser context.This is also a proof-of-concept/lay-the-groundwork for moving other components from core to browser.
It also includes an automated test,
scripts/customBuild.spec.jsthat runs custom build.To validate
Generate two custom builds
ActivityCollector-node packages/browser/scripts/alloyBuilder.js build --no-minify -o /tmp/alloy-buildnode packages/browser/scripts/alloyBuilder.js build --exclude activityCollector --no-minify -o /tmp/alloy-build-no-activityVerify that the first is bigger (filesize) and has
ActivityCollectorand that the second is smaller and does not contain it.Related Issue
Motivation and Context
Screenshots (if appropriate):
Checklist:
pnpm changeset) or it is not necessary because this PR is not consumer-facing.