D5 :: 3PS :: Example Modules :: Migrate Legacy Types - #72
Open
ayubadiputra wants to merge 9 commits into
Open
Conversation
… wire Elements callbacks - Add module metadata for layout/html/elements on showcase modules; Group-style Elements on Parent; childrenName [] on leaf examples. - Register elementsCallbacks and render element children in VB for leaf modules. - Document optional "any module as child" pattern for Parent in README and JSDoc. Part of elegantthemes/Divi#48612
…Module Use childrenName listing example/child-module plus allowAllElements (Accordion pattern) so Divi’s is-valid-child still accepts category child-module while opening the module picker to regular modules. Update VB wrapper, SCSS, and README/index JSDoc; child edit uses a div root for mixed child types. Part of elegantthemes/Divi#48612
…e FE - Append WordPress-rendered inner block HTML ($content) to Module::render for Dynamic, Static, D4, and Parent so Elements children appear on FE - Replace ElementComponents background output with style_components(module) where updated, and pass childrenIds via ChildrenUtils::extract_children_ids - D4: stop shadowing $content when rendering the content element (richtext) Part of elegantthemes/Divi#48612
…r Static, Dynamic, Divi 4 example modules Align Static, Dynamic, and Divi 4 example modules with core Audio patterns for Divi 5 Layout. - Add module.json styleProps.layout selectors targeting each module’s inner wrapper. - Apply et_flex_module / et_grid_module from decoration.layout display in VB (edit.tsx) and FE (RenderCallbackTrait via HTMLUtility::classnames). - Scope module Advanced > Text styles to the module order class in styles.tsx and ModuleStylesTrait so layout flex/reverse is not overridden on the inner node. - Dynamic: pass defaultPrintedStyleAttrs on module styles (VB parity with PHP). - D4: fold standalone TextStyle into elements.style advancedStyles; fix CommonStyle parallax so position:relative only applies when parallax is enabled. - Rebuild scripts/bundle.js and styles bundles. Refs: elegantthemes/Divi#48612
Add example/module-settings-demo as a D5-only sandbox for Content panel field types (text, richtext, select, checkboxes) under one Content group. VB/FE use framework render for text and rich text; select and checkboxes resolve labels from shared TS/PHP option maps in ascending checkbox order. Fixes elegantthemes/Divi#49970
…ckages Replace legacy `divi-types-*` and `@types/divi__*` aliases with direct `@divi/*` dependencies per Release 5.1. Require Node >= `20.18.1` for `undici@7.x` engine checks, pin `@types/codemirror` via overrides, and configure `sass-loader` to use Dart Sass `modern-compiler` API. Re-enable `ts-loader` type-checking and update `README` install and troubleshooting notes. Fixes elegantthemes/Divi#49115
npm types to scoped @divi/* pa…
shohel
requested changes
Jun 4, 2026
shohel
left a comment
Contributor
There was a problem hiding this comment.
@ayubadiputra This PR has merge conflicts, Please resolve it.
Thanks
Member
Author
|
@shohel Thanks! I addressed your feedback. |
…son file when running reset-install script. Part of elegantthemes/Divi#48612
Contributor
|
@ayubadiputra please fix merge conflict |
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.
The Issue
Issue Reference
Fixes: https://github.com/elegantthemes/Divi/issues/49115
Root Cause
Divi 5.1 moved Visual Builder type definitions from legacy
divi-types-*packages (installed via npm aliases like@types/divi__module→divi-types-module) to first-party scoped@divi/*packages. The D5 Extension Example Modules plugin still depended on the old alias pattern and bundled ~25 unused type packages, which caused:@divi/*workflow.npm installfailures on current Node — transitiveundici@7.x(viaenzyme→cheerioand@wordpress/scripts→jest-environment-jsdom→jsdom) requires Node>= 20.18.1, whileengines.nodewas still>= 18.0.0and.npmrchasengine-strict=true.@divi/modulepulls in@divi/field-library, which requests@types/codemirror@5.65.16, a version that was never published to npm.sass-loaderused Dart Sass’s deprecated legacy JS API, producing deprecation warnings on every SCSS compile.The README also documented known
placeholderContenttype errors as a temporary workaround tied to the olddivi-typespackages, which blocked a clean developer experience.Historical Context
Git history shows the legacy npm alias setup was introduced early in the extension’s life (
7e824ae— Fikri Rasyid, “Removed yarn setup, points package.json to actual types package”). Over time, more@types/divi__*aliases were added as the example modules grew.transpileOnly: truewas later added tots-loader(e257cb0) to keep builds unblocked while legacy type packages lagged behind Divi core. Release 5.1’s scoped@divi/*packages are the intended long-term replacement; this PR updates the reference extension so third-party developers follow the current model.The Pull Request
Solution Approach
Migrate the example extension to Release 5.1’s scoped type packages and document the migration path for third-party developers:
@divi/*packages — Remove alldivi-types-*/@types/divi__*npm aliases. Add only the packages actually imported by the example modules:@divi/types,@divi/module,@divi/module-library,@divi/module-utils,@divi/rest,@divi/style-library, and@divi/icon-library. Unused legacy packages are dropped; npm resolves related transitive@divi/*dependencies automatically.package-lock.jsonwithnpm run reset-installafter the dependency swap.engines.nodeto>= 20.18.1to satisfyundici@7.xengine checks underengine-strict=true.@types/codemirror— Add an npmoverridesentry (5.60.17) to work around the unpublished5.65.16version requested by@divi/field-library.sass-loaderwithapi: 'modern-compiler'to use Dart Sass’s modern compiler API and eliminate legacy JS API deprecation warnings.placeholderContentworkarounds) with Release 5.1 guidance: required Node version, scoped@divi/*install model, and troubleshooting for missing types / failed installs.Screencast Verification
Install Works
Build Works
Load and Edit Module Works
Load.and.Eddit.Works.mp4
Testing & Verification
npm run reset-installto refreshnode_modulesandpackage-lock.json. Make sure it's done successfully.npm run startto start the project. Make sure it's done successfully.npm run buildto build the project. Make sure it's done successfully.Alternative Solutions (if any)
@types/divi__*aliases — Rejected; deprecated in Release 5.1 and misleads third-party developers.@divi/*package explicitly — Rejected; npm resolves transitive type dependencies; only packages with direct imports are listed indevDependencies.npm install --ignore-engines— Documented as a temporary workaround only; not suitable as the default because.npmrcusesengine-strict=true.@types/codemirror@5.65.16— Not viable; version was never published. npmoverridesto5.60.17is the practical fix until@divi/field-libraryupdates its dependency.transpileOnly: truefromts-loaderimmediately — Considered; deferred for a follow-up once all example module sources are verified clean against the new@divi/*types under full type-checking.Changelog
Updated D5 Extension Example Modules to use scoped
@divi/*npm type packages per Divi 5.1, with updated Node.js requirements and build configuration for a clean install and compile experience.