Experiments Portlet — migration: delete the old per-page experiments UI and remove the flag
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
The epic's strategy is: build the new portlet complete, then migrate and delete the old one. This is the issue where the duplication ends. It is filed up front — together with the rest of the epic — so "delete old later" is a scheduled step, not a wish that never happens.
This is deliberately the only issue that rewrites/removes existing code at scale.
Entry condition: every "port" row of the functional-parity inventory verified working in the new portlet on the dev/QA instance, and the E2E suite (#37006) green. Nothing is deleted before its replacement is verified.
Delete
- The old per-page UI in
libs/portlets/dot-experiments/portlet/src/lib/:dot-experiments-shell/,dot-experiments-list/(including the drawer create component),dot-experiments-configuration/,dot-experiments-reports/,dot-experiments-analytic-app-misconfiguration/, the oldshared/tree, and the oldlib.routes.ts(dotExperimentsRoutes). - With them go: the three
@ngrx/component-storestores, the 10 hardcodedrouter.navigate(['/edit-page/…'])calls, and thewindow.location.href-parsinggetUrl()— no decoupling refactor needed; the code that holds them disappears.
Rewire
- UVE entry point permanently targets the new flow; remove
FEATURE_FLAG_EXPERIMENTS_PORTLET— the entry-point flag introduced by #37005 — itswithFlagswiring, itsFeaturedFlagsentry, itsConfigurationResourceallow-list entry, and its explicitfalseindotmarketing-config.properties. - Do not remove
FEATURE_FLAG_EXPERIMENTS. Despite the name, it is not a frontend flag: it is the backend kill-switch for the whole Experiments feature, read byConfigExperimentUtil.isExperimentEnabled()and gating experiment JS injection (ExperimentWebAPIImpl:338) and experiment resolution during page render (HTMLPageAssetRenderedAPIImpl:176,239). Removing it would stop experiments from serving to visitors. It keeps its name, meaning, default and consumers. The unused enum entryFeaturedFlags.LOAD_FRONTEND_EXPERIMENTS = 'FEATURE_FLAG_EXPERIMENTS'(shared-models.ts:28) never gained a consumer and can be deleted here — the property cannot. - Update
libs/portlets/edit-ema/portlet/src/lib/lib.routes.ts:117(the lazy import ofdotExperimentsRoutes) and the nav specdot-ema-shell.component.spec.ts:117-120to the new routes. - Promote
site-wide/to the lib root; the components copied intosite-wide/shared/become the only copies.
Clean up
- Move the chart colors in
libs/dotcms-models/src/lib/dot-experiments.model.ts:204-215behind a lazy getter, removing the import-timegetComputedStyle(document.body)and the spec stubs #36989 added. - Remove i18n keys used only by the deleted screens.
- Remove
AllowedActionsByExperimentStatuskeys that no longer have a consumer (verify — the matrix itself stays; the new portlet reads it).
Acceptance Criteria
- Entry condition documented as met: parity checklist signed off on dev/QA; #37006 green.
- The old tree and
dotExperimentsRoutesare gone;pnpm nx build dotcms-uiand all specs pass. - UVE experiments entry lands in the new flow with no flag involved;
FEATURE_FLAG_EXPERIMENTS_PORTLETand its consumers are removed. -
FEATURE_FLAG_EXPERIMENTSand its backend consumers are untouched; experiments still serve to site visitors after the migration. - No import of
@ngrx/component-storeremains underlibs/portlets/dot-experiments/. -
dot-experiments.model.tsno longer runsgetComputedStyleat import time. - The whole E2E suite passes (the
FEATURE_FLAG_EXPERIMENTS_PORTLET-off regression spec is retired with that flag). - Grep proof in the PR: no
edit-page/…navigation remains under the experiments lib.
Priority
Low until Screens 1-3 + UVE land; then it is the closing step of the epic.
Additional Context
- Depends on: #36989, #37003, #37004, #37005, #37006, #37007.
- Out of scope: registering the portlet for customers (UpgradeTask + starter bump) — separate decision, gated on #36823's permission filtering being in the build.
- Verify:
pnpm nx lint|test portlets-dot-experiments-portlet·pnpm nx test portlets-edit-ema-portlet·pnpm nx test dotcms-ui --testPathPattern=app.routes·pnpm nx build dotcms-ui·npx playwright test --grep @experiments
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
First verify the parity checklist and #37006, then inspect the old tree under libs/portlets/dot-experiments/ and the routes in edit-ema/lib.routes.ts:117. Run the listed portlet, dotcms-ui, build, and Playwright checks while removing the old routes and flag wiring. Done means the old tree and flag are gone, backend FEATURE_FLAG_EXPERIMENTS consumers remain untouched, and all checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- playwright, typescript
- Domain
- build-system, frontend, testing-qa
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 22/100