Skip to content

Document BuildJsScope model and split tracking scripts - #606

Merged
adiati98 merged 1 commit into
mautic:7.2from
Promptless:promptless/pr-16660-mtc-script-split-7.2-rehome
Jul 29, 2026
Merged

Document BuildJsScope model and split tracking scripts#606
adiati98 merged 1 commit into
mautic:7.2from
Promptless:promptless/pr-16660-mtc-script-split-7.2-rehome

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Updates the MauticJS tracking script developer page (docs/mauticjs_api/tracking_script.rst) to document the JS build scope model introduced in mautic/mautic#16660 ("Split mtc.js into essential and tracking scripts", MTC-11100).

New developer-facing surface documented:

  • The Mautic\CoreBundle\Event\BuildJsScope enum (RUNTIME, ESSENTIAL, TRACKING).
  • BuildJsEvent::appendJsForScope($js, BuildJsScope $scope, $section = '') and acceptsScope(BuildJsScope $scope): bool, with plugin-style PHP subscriber examples.
  • A note that legacy appendJs() now delegates to appendJsForScope() with BuildJsScope::TRACKING, plus a backward-compatibility warning (with argument-position migration guidance) that appendJs()-only subscribers are excluded from /mautic-essential.js.
  • The generated endpoints (/mautic-essential.js, /mautic-tracking.js, /mtc.js) and their scope mappings.
  • Client-side runtime globals (MauticJS.runtimeReady, trackingEnabled, requestWithCredentials) and the mauticEssentialReady event, with a safe dual-path readiness guard example.

No new Vale errors introduced; the one pre-existing baseline finding on unchanged content remains.


This PR re-homes the identical documentation content from #601 onto a fresh branch at @adiati98's request, so the new PR head receives a clean Read the Docs build status from the start. The Read the Docs check on #601 stayed stuck against a stale commit and did not clear after a dashboard rebuild, a close/reopen, or an empty commit. The documentation substance is unchanged from #601, including the review responses already applied there for @patrykgruszka and @adiati98.

Replaces #601.

Source PR: mautic/mautic#16660

Trigger Events

This documentation update was prepared by Promptless.

Documents the JS build scope model from mautic/mautic#16660: the BuildJsScope
enum, BuildJsEvent::appendJsForScope()/acceptsScope(), the /mautic-essential.js
and /mautic-tracking.js endpoints, client-side runtime globals, and the
backward-compatibility impact on legacy appendJs() subscribers.

Re-homed from mautic#601 to a fresh branch at @adiati98's request so the new PR head
gets a clean Read the Docs status from the start.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Just a reminder: I review PR comments by default. If you want me to ignore a specific comment, start it with aside or /aside.

@adiati98
adiati98 merged commit 3fed2be into mautic:7.2 Jul 29, 2026
3 checks passed
@promptless-for-oss
promptless-for-oss deleted the promptless/pr-16660-mtc-script-split-7.2-rehome branch July 29, 2026 18:20
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.

2 participants