WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 weeks ago

#31596 new task (blessed)

Make it easier to update TinyMCE

Reported by: iseulde Owned by:
Milestone: Future Release Priority: low
Severity: normal Version:
Component: TinyMCE Keywords:
Focuses: javascript Cc:
PR Number:

Description

  • Load from src like the other tests
  • Automatically add the plugins without overwriting files.
  • Don't run tests where no plugins are loaded. We're running these test just to test our plugins.
  • Remove everything we don't use.

Attachments (1)

31596.patch (27.0 KB) - added by iseulde 5 years ago.

Download all attachments as: .zip

Change History (11)

@iseulde
5 years ago

#1 @samuelsidler
5 years ago

  • Priority changed from normal to low

This ticket was mentioned in Slack in #core by drew. View the logs.


5 years ago

#3 @DrewAPicture
5 years ago

  • Keywords has-patch added
  • Milestone changed from 4.2 to Future Release

This is not crucial for 4.2. Punting.

#4 @azaozz
5 years ago

Load from src like the other tests

We used to do that. However in some (rare) cases things can get broken during the build. I'd rather know that the concatenated, pre-compressed TinyMCE works properly :)

If testing /src is so important, we can add another link for it.

Automatically add the plugins without overwriting files.

Not sure about that. "Duck-punching" tinymce.EditorManager doesn't seem good :)

Don't run tests where no plugins are loaded. We're running these test just to test our plugins.

We are running all TinyMCE tests with all of our plugins loaded. There are few tests where not all of TinyMCE is loaded. We can exclude these but... What's the benefit? Will have to edit more and more files just for saving few milliseconds of tests that are very rarely run? The opposite is true -- more maintenance, see below.

Remove everything we don't use.

That's nice but will mean more and more maintenance. The TinyMCE tests are typically updated on every release. The more we deviate from the originals, the more maintenance will be needed.

The easiest way to maintain edited files is when we include the whole file and comment out the parts we don's use. If we "scramble" the blocks/line numbers it gets much harder.

Also the patch removes our Obsolete.js tests. That's not good, we've had many failures there in the past. Even if all the rest of the tests are removed, this one should stay.

Last edited 5 years ago by azaozz (previous) (diff)

#5 @azaozz
5 years ago

Also, these tests have to be run in all supported browsers. The only sensible way to do that at the moment is to run them by hand" in each browser and version.

They can be run in "headless WebKit" automatically from cli, but that's not good as big part of TinyMCE deals with browser quirks, differences and normalization.

#6 @iseulde
5 years ago

So how do we start adding our own tests for e.g. wpviews? For these test it does make sense to run them in a headless browser, as well as run the tests in all supported browsers. Just wanted to make it a bit easier to add our own.

#7 @azaozz
5 years ago

IMHO best would be to have another "runner", i.e. a separate https://core.trac.wordpress.org/browser/trunk/tests/qunit/editor/index.html just for our tests. Then we can auto-run them on precommit (same as the other JS tests). The full MCE tests will still be run "by hand".

That way we will be in "full control" what, when and how to run the tests :)

Last edited 5 years ago by azaozz (previous) (diff)

#8 @iseulde
3 years ago

  • Keywords needs-patch needs-docs added; has-patch removed
  • Summary changed from TinyMCE test adjustments to Make it easier to update TinyMCE

Renaming because my intention was to make it easier to update TinyMCE (by anyone) and easier to maintain.
If we don't change anything, we should at least document the process somewhere. It's not that obvious, even to me.

This ticket was mentioned in Slack in #core-editor by azaozz. View the logs.


3 years ago

#10 @azaozz
3 weeks ago

  • Keywords needs-patch needs-docs removed
  • Type changed from defect (bug) to task (blessed)

Updating TinyMCE is quite straightforward now. It is as simple as copying over the new files from the dev package to /src/js/_enqueues/vendor/tinymce/. This should include the /themes, /skins, and the subset of default /plugins WP is using. All of the default (upstream) TinyMCE tests have been removed as they don't make sense to run in WP any more.

There were few "hacks" before but all have been removed for quite some time. The only remaining inconsistency in the WP implementation is that after copying the new files the tiny_mce_popup.js file and utils directory have to be moved to the root /tinymce directory from /plugins/compat3x/, and changes to /plugins/compat3x/css/dialog.css have to be reverted. Both of these are needed to support super old custom TinyMCE plugins from version 3.x (5+ years).

The only other change is to update $tinymce_version in wp-includes/version.php with the new version string. This is used mostly to break caches and (historically) contains the date the update was made in a yyyymmdd format.

This applies to updating TinyMCE's 4.9.x branch. Changing to "task" and leaving open so it's easier to find in case it's needed :)

Note: See TracTickets for help on using tickets.