Add support for both CJS/ESM plugins#2876
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2876 +/- ##
=======================================
Coverage 71.04% 71.04%
=======================================
Files 131 131
Lines 7117 7119 +2
Branches 1683 1653 -30
=======================================
+ Hits 5056 5058 +2
- Misses 1961 2055 +94
+ Partials 100 6 -94 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gerteck
left a comment
There was a problem hiding this comment.
LGTM! thanks for the PR, just some notes or possible nits
Documentation lists v22 as minimum node version. Due to changes in ESM migration, core uses `createRequire` to import custom plugins. This can work with ESM, but it's locked behind an experimental flag for the CLI. List minimum version to v22.12 so users can use custom ESM plugins without issues.
...nctional/test_site_custom_plugins/expected/markbind/bootstrap-icons/font/bootstrap-icons.css
Show resolved
Hide resolved
There was a problem hiding this comment.
LGTM, just a comment on the comment
Also, in the PR description, could you add if applicable:
Breaking change release note preparation (if applicable):
To be included in the release note for any feature that is made obsolete/breaking
Give a brief explanation note about:
what was the old feature that was made obsolete
any replacement feature (if any), and
how the author should modify his website to migrate from the old feature to the replacement feature (if possible).
An example is in #2622
Just tested, there's no breaking change in v6.0 vs now 👍 |
What is the purpose of this pull request?
Resolves #2867
Can consider closing #2851
Overview of changes:
(Scope of this PR shifted quite a bit, but ultimately it's still addressing the same )
Updates plugin loading logic to load .cjs/.esm files, allowing for more flexibility when mixing modules in the markbind plugin directory.
Adds a new test site to test out all possible configurations of scopes and plugin modules.
Adds documentation on how to manage the different module systems with plugins. Bump minor version of node in user guide.
Check out the deploy preview's "Writing Plugins" page for the changes
Details
Anything you'd like to highlight/discuss:
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Add support for both CJS/ESM plugins
Let's
allow for ESM loading using
requireChecklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):