Opened 21 months ago
Last modified 4 weeks ago
#47218 new enhancement
Update TinyMCE to 5.X.X
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | 2nd-opinion |
Focuses: | Cc: |
Description
TinyMCE Version 5.0.5 has been released on May 9, 2019, see:
https://www.tiny.cloud/docs/release-notes/release-notes50/
https://www.tiny.cloud/docs/changelog/
Don't we want to keep it up to date?
It could break things, though, see :
https://www.tiny.cloud/docs/migration-from-4x/
related: #47205
Change History (9)
This ticket was mentioned in Slack in #core-editor by modernnerd. View the logs.
11 months ago
#7
@
5 weeks ago
Been looking at/thinking about what are the best options here for a while. The problem is that there is no official "migrate" plugin when upgrading from 4.x to 5.x like the compat3x
plugin for migrating (back-compat) from 3.x to 4.x.
There are quite a few API changes in 5.x: renamed methods, deprecated functions and settings, new UI with a bit different HTML stricture and CSS classes, etc. that break backwards compatibility. See: https://www.tiny.cloud/docs/migration-from-4x/.
For example, editor.addButton()
is perhaps the most used API call in WordPress plugins that add custom TinyMCE plugins. In TinyMCE 5.x this results in an error, see: https://github.com/tinymce/tinymce/blob/014d8599bb398168a98e8c9964bc29a394d75cd8/modules/tinymce/src/core/main/ts/api/Editor.ts#L1130. Changes:
TinyMCE 4:
editor.addButton('mybutton', { text: 'My Button', cmd: 'mceSave' });
TinyMCE 5:
editor.ui.registry.addButton('myButton', { text: 'My Button', onAction: function () { editor.execCommand('mceSave'); } });
(In addition the "button settings" have changed too. There's no more support for cmd
, instead a callback function is needed, and there's no onclick
, has been renamed to onAction
.)
What it will take to upgrade TinyMCE to version 5.x in WordPress?
As far as I see:
- Create a team of (as many of) the authors of WordPress plugins that add TinyMCE code/plugins. The main purpose of the team would be to determine and then test all needed changes to core, and perhaps to "spread the word".
- Make an in-house
compat4x
plugin for TinyMCE 5.x. Looks like it won't be possible to have "full" compatibility, but most cases of deprecation and renamed functions/methods can be patched/fixed. - Make a feature plugin with the updated TinyMCE and the above compat plugin.
- Test the feature plugin. Ask "everybody" to test as much as possible to catch edge cases that can be fixed/patched.
#8
@
5 weeks ago
I am interested in this as I use TinyMCE for bbPress. I also have my own plugin that adds a couple of plugins to the toolbar functionality.
But, I am not a PHP programming. My knowledge of TinyMCE is limited. I would like to see it supported else I will have serious problems down the road with bbPress. Since TinyMCE authors are cutting off support for v4 at the end of 2020.
#9
@
4 weeks ago
Naturally many times the TinyMCE has been updated. Like when it went from 3 to 4. So is it documented where code needs changing? Someone (not me) needs to take charge of any team and direct people on what bit they can do.
It just seems like we are reinventing the wheel a bit. Someone must know what code in WordPress makes use of TinyMCE as a starter. But if not, how do we find out?
There are no plans (for now) to migrate to TinyMCE 5. Yep, see https://www.tiny.cloud/docs/migration-from-4x/.