Skip to content

Split packages/core into packages/core and packages/browser#1411

Merged
carterworks merged 76 commits intomainfrom
create-browser-package
Mar 9, 2026
Merged

Split packages/core into packages/core and packages/browser#1411
carterworks merged 76 commits intomainfrom
create-browser-package

Conversation

@carterworks
Copy link
Collaborator

@carterworks carterworks commented Dec 5, 2025

Warning

This PR is based off of #1414, which itself is based off of #1412, so this should not be merged until they are.

Description

This PR changes the publishing artifact from being the packages/core folder to a new folder called packages/browser. And that folder gets the @adobe/alloy, and then the core folder appropriately gets the name @adobe/alloy-core. The intent is that both of these packages will be published to NPM.

The core package will be buildless, and then all build steps as well as integration and functional tests, anything to do with a browser stays in the browser package.

No functionality or browser specific functionality has been removed from the packages, the core package, but that is kind of the next step, and hopefully that work can be parallelized.

As it stands right now, the CI test and the publishing workflow still need to be completed. But right now this branch is 95% done.

Related Issue

Motivation and Context

Screenshots (if appropriate):

Checklist:

  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.

@carterworks carterworks self-assigned this Dec 5, 2025
@carterworks carterworks added the ignore-for-release Do not include this PR in release notes label Dec 5, 2025
# Conflicts:
#	package.json
#	packages/browser/test/integration/helpers/mocks/emptyEventResponse.json
#	packages/browser/test/integration/helpers/mocks/mediaSessionResponse.json
#	packages/browser/test/integration/helpers/mocks/targetCustomCodeAction.json
#	packages/browser/test/integration/helpers/mocks/targetPrependHtmlAction.json
#	packages/browser/test/integration/specs/Advertising/consent_gate.spec.js
#	packages/core/package.json
#	packages/core/test/unit/specs/components/Advertising/handlers/viewThroughHandler.spec.js
# Conflicts:
#	package.json
#	packages/browser/test/integration/specs/Advertising/clickthrough_duplicate_skwcid.spec.js
@carterworks carterworks marked this pull request as ready for review February 17, 2026 16:23
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
import fs from "fs";
Copy link
Member

Choose a reason for hiding this comment

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

I find it a little weird that in a file from src we are using Node APIs. If this file would be read by a bundler, it might crash. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's actually the other way around - rollup polyfils calls to fs, so if it is called by the browser then it will crash.

It is looking more and more likely that I need to abandon the goal of being buildless.

Copy link
Collaborator Author

@carterworks carterworks Feb 24, 2026

Choose a reason for hiding this comment

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

You and I talked in person and discovered that the functionality of componentMetadata.js can be moved into the alloyBuilder, because that is the only place that it is used.

  • do that

await makeSendServiceWorkerTrackingData(
{
/* eslint-disable-next-line no-underscore-dangle */
xdm: data._xdm.mixins,
Copy link
Member

Choose a reason for hiding this comment

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

Will data always have an _xdm key?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just a copy-paste from your serviceWorker.js file, so it will depend on what gets attached to notificationclose service worker events, as it did before.

See:

async onNotificationClose(event) {

* @param {NotificationEvent} event
*/
onNotificationClick(event) {
serviceWorkerNotificationClickListener({
Copy link
Member

Choose a reason for hiding this comment

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

onPush returns a listener while onNotificationClick returns undefined. Should we return here too?

@dompuiu
Copy link
Member

dompuiu commented Feb 24, 2026

There is something wrong with the linting. Running pnpm run lint doesn't show any errors. But if you open the file packages/browser/scripts/helpers/entryPointGeneratorBabelPlugin.js, you should see prettier errors (I tested in nvim and vscode).

"build:clean": "rimraf dist distTest",
"build:types": "tsc -p jsconfig.json --declaration --emitDeclarationOnly --outDir dist/types --checkJs false --noEmit false",
"build": "pnpm run build:clean && rollup -c --environment BASE_CODE_MIN,STANDALONE,STANDALONE_MIN,SERVICE_WORKER,SERVICE_WORKER_MIN,BUNDLESIZE && pnpm run build:types",
"build:watch": "rollup -c --watch",
Copy link
Member

Choose a reason for hiding this comment

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

The build:watch doesn't work

@dompuiu
Copy link
Member

dompuiu commented Feb 24, 2026

How do you run the dev command now that was removed from the root package.json?

@dompuiu
Copy link
Member

dompuiu commented Feb 24, 2026

In rollup.config.js there are some typos: brotili instead of brotli.

# Conflicts:
#	package.json
#	packages/browser/src/serviceWorker.js
#	packages/browser/test/integration/helpers/utils/location.js
#	packages/browser/test/integration/specs/Advertising/options_modes.spec.js
#	packages/browser/test/integration/specs/StreamingMedia/mediaEvents.spec.js
#	packages/core/test/functional/specs/BrandConcierge/sendConversationalEvent.js
#	packages/core/test/unit/specs/components/Advertising/createComponent.spec.js
#	packages/core/test/unit/specs/components/Advertising/handlers/clickThroughHandler.spec.js
#	packages/core/test/unit/specs/components/Advertising/handlers/createAdConversionHandler.spec.js
#	packages/core/test/unit/specs/components/Advertising/handlers/onBeforeSendEventHandler.spec.js
#	packages/core/test/unit/specs/components/Advertising/handlers/viewThroughHandler.spec.js
#	packages/core/test/unit/specs/components/Advertising/utils/helpers.spec.js
#	packages/core/test/unit/specs/components/PushNotifications/request/makeSendServiceWorkerTrackingData.spec.js
#	packages/core/test/unit/specs/core/identity/createIdentity.spec.js
@carterworks carterworks merged commit 82830a5 into main Mar 9, 2026
5 checks passed
@carterworks carterworks deleted the create-browser-package branch March 9, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Do not include this PR in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants