Skip to content

[6.x] Export the control panel modules plugin bundles need - #20359

Closed
brianjhanson wants to merge 7 commits into
chore/js-modules-jqueryfrom
feature/cp-plugin-module-exports
Closed

brianjhanson wants to merge 7 commits into
chore/js-modules-jqueryfrom
feature/cp-plugin-module-exports

Conversation

@brianjhanson

@brianjhanson brianjhanson commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Publishes the control panel utilities plugin bundles need through the import map, so plugins share the CP's instances instead of bundling their own or relying on Yii2 adapter globals.

Cp::sharedModules()
  vue                 -> resources/js/vue.ts
  @craftcms/cp         -> resources/js/cp-module.ts
  @craftcms/garnish    -> resources/js/garnish.ts

@craftcms/cp adds translation, escaping, HTML insertion, HTTP and URL helpers, config access, slideouts, element editors, chip actions, thumbnails, the image editor, and the uploader. cpConfig() returns the existing ConfigService singleton. Garnish is a re-export of the existing package.

craftcms/ckeditor#643 consumes these exports. Its latest revision removes upload placeholders and simplifies the toolbar without requiring further CMS changes. HtmlSanitizerManager::config() remains separate in #20328.

Evidence

  • Before: The original control panel probe could not import @craftcms/garnish, and @craftcms/cp lacked t, actionClient, and cpConfig.
    After: The original probe resolved the added exports and confirmed cpConfig() === window.Cp.$config. This evidence predates the CKEditor simplifications; no new CMS code was added during that review.
  • The import-map test now covers the Garnish entry in the published Vite manifest.
  • CKEditor's latest Chromium checks pass for toolbar add/remove, canceled drags, reduced motion with forced colors enabled, image upload completion, transforms, and upload failures. Those checks use the real editor and Garnish libraries with controlled CP/upload boundaries, not the live import map.

Related issues

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

@brianjhanson
brianjhanson marked this pull request as ready for review November 4, 2026 20:28
Without it the module never lands in the manifest, so resolving the
import map throws outside the dev server.
@brianjhanson brianjhanson changed the title Export the control panel modules plugin bundles need [6.x] Export the control panel modules plugin bundles need Nov 4, 2026
@brianjhanson
brianjhanson added this pull request to stack #20363 November 4, 2026 22:22
@brianjhanson

Copy link
Copy Markdown
Contributor Author

Collapsed into #20378, which carries this work plus #20276 and #20320 on a single branch rebased onto 6.x. Reviewing one branch beats keeping three bases in sync.

All five commits came across, so @craftcms/cp's added exports, cpConfig(), Uploader, the @craftcms/garnish import-map entry and its vite.config.js input all live in #20378 now, along with the HandleInertiaRequestsTest coverage for the Garnish manifest entry.

craftcms/ckeditor#643 should retarget to #20378.

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.

1 participant