editor: migrate from TinyMCE to HugeRTE MIT fork#337
Draft
mirekys wants to merge 5 commits into
Draft
Conversation
* Replaces tinymce ^6.7.2 with hugerte ^1.0.10 * Replaces @tinymce/tinymce-react ^4.3.0 with @hugerte/hugerte-react ^2.0.2
* Replaces tinymce/* imports with hugerte/* equivalents * Replaces @tinymce/tinymce-react with @hugerte/hugerte-react
* Removes unnecessary function wrapper around value prop
* Adds explicit base_url to RichEditor config, so HugeRTE resolves skin CSS paths correctly, when bundled inside Webpack/Rspack chunks. Without base_url, HugeRTE's auto-detection fails, because hugerte script is inside a dynamic chunk, not a standalone <script>.
* Adds patch-hugerte-langs.js and copy-hugerte-langs.js build scripts * Adds locale detection via MutationObserver on document.documentElement * Loads locale packs on demand via explicit dynamic import() map * Wires locale prop through RichInputField and RichInput widget * Updates Editor key to include localeLoaded for remount timing * Adds tinymce-i18n devDependency for HugeRTE language packs
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.
❤️ Thank you for your contribution!
Description
Replaces TinyMCE with HugeRTE, an MIT-licensed fork, to avoid the GPL/commercial licensing of TinyMCE 7+. Updates all imports, package dependencies, API should be compatible with TinyMCE v6 (should be a drop-in replacement).
Starting with TinyMCE 7, we'd otherwise have to decide whether to go with commercial or GPLv2+ license,
which I think is a no-go for this project, see:
https://www.tiny.cloud/docs/tinymce/latest/license-key/
Warning:
This PR requires webpack.py copypath updates in (otherwise the editor component renders as blank div):
Wee'll need to rename
.../node_modules/tinymce/skins/content/...to.../node_modules/hugerte/skins/content/...See for example: https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/theme/webpack.py#L80-L97
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: