Repository navigation
[6.x] Legacy bridge - #19884
Draft
brianjhanson wants to merge 50 commits into
Draft
[6.x] Legacy bridge#19884brianjhanson wants to merge 50 commits into
brianjhanson wants to merge 50 commits into
Conversation
Staring to port the Shopify plugin and had to make these undocumented changes
# Conflicts: # CHANGELOG.md # resources/js/common/layouts/screens/PageScreen.vue # resources/templates/_includes/forms/editableTable.twig # src/Cp/Html/ContentHtml.php # src/Cp/Navigation.php # src/Markdown/Flavors/GfmFlavor.php # tests/Unit/Markdown/MarkdownTest.php
📚 Storybook previews@craftcms/ui — open Storybook Changed components:
resources/js — open Storybook No changed components detected in this Storybook. |
This was referenced Oct 7, 2026
This branch has not been deployed
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.
Lets a Craft 5-era control panel screen render inside the Inertia shell without its author changing anything, and ports the form controls those screens rely on to web components.
A plugin that hasn't been updated for Craft 6 still returns
asCpScreen()responses, callsrenderTemplate(), and extends_layouts/cp. All three now arrive at BridgedScreen as server-rendered strings for the shell's slots, so the screens draw correctly instead of losing their tabs, assets and JS.Screen bridge
LegacyScreenFragmentscollects a legacy screen's fragments;BridgedScreenwraps them for cp/Screen.vue, which draws them into the shell's slots.RenderBridgedScreenmiddleware and_layouts/cp-fragments.twigcover the template and renderTemplate() routes into it.LegacyReadyShimholds ready-JS until the markup is mounted — Vue mounts a bridged screen after the document parses, soDOMContentLoadedhas already fired.HtmlStack::deferInlineJs()wraps body-end inline JS to match.PageLifecycleno longer drops assets for a position with no placeholder in the output; they go back on the stack instead.LegacyAdminTable.vue.Element index
{% extends "_layouts/elementindex" %}gets the new Vue index. The layout declares it, since it's the one place that knows the element type; a child that replaces the content block opts back out via a sentinel.ContentIndexViewModel::sourceNavItems()builds them.Navigation::sourceSubnav()is now public, so a plugin building its own nav section can hang an element type's sources off it the way the core sections do.Tabs
LegacyTabsShimpairs a legacy screen's panes to<craft-tabs>, so a bridged screen gets the same tab component as the rest of the control panel. It returns null whenever it isn't certain, and the legacy strip covers that.<craft-tabs>mirrors the selected tab in the location hash and selects from it on load, enabled by default. Saving keeps the current hash.Form controls
<craft-combobox>rather than Vue 2 instances, throughcraft.cp.autosuggest()/craft.cp.selectize()andFormFields::autosuggestFromConfig()/selectizeFromConfig(). Craft 5's variable shapes are still accepted.Plugin API and Yii adapter
getVersion()stays out of the Craft 6 plugin API. The adapter keeps it, reading and writing$versionand logging a deprecation, so a plugin author gets told rather than guessing.Craft::getAlias()returns a non-alias value unchanged; the Craft 6 utility base class extends the legacy one.Note for review
The last commit pulls two commits from #19665 — Cp::sharedModules(), resources/js/vue.ts and resources/js/elements.ts — which publish the control panel's Vue runtime and element index to plugin bundles through an import map. A plugin that externalizes those specifiers (Commerce does) can't boot without them. They'll want dropping in favour of #19665 whenever that lands.
Testing
Exercised against Commerce and a Craft 5-era plugin on a 6.x install: plugin settings screens with tabs and editable tables, autosuggest and selectize fields, and a bridged product index with its sources in the subnav.