-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TinyMCE to the latest version #2787
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2787 +/- ##
==========================================
+ Coverage 33.93% 36.52% +2.58%
==========================================
Files 193 200 +7
Lines 5702 6703 +1001
Branches 1000 1255 +255
==========================================
+ Hits 1935 2448 +513
- Misses 3187 3566 +379
- Partials 580 689 +109
Continue to review full report at Codecov.
|
There's no good fix for the errors without addressing it in TinyMCE: tinymce/tinymce#3947 |
FYI 4.7.0 was released today: |
Yep :) |
9a92ef9
to
1c0ae06
Compare
1c0ae06
to
f8c32d6
Compare
Does anyone know why this is a dependency in |
@iseulde maybe unit tests? |
Am I missing something? https://github.com/WordPress/gutenberg/search?utf8=✓&q=import+tinymce&type= Is it the Editable component in a test? Why is it not the some TinyMCE file? |
b15b5a7
to
c9bb6c5
Compare
So now the tests have undefined global errors. That's not supposed the run in node... |
c9bb6c5
to
16a593d
Compare
The tests run entirely in Node. Even if the tests don't explicitly import TinyMCE, the files under test may do so (either directly or indirectly). While in the browser the |
@aduth Yep, adjusted that file. Thanks. I was more wondering why we don't use the NPM module for the browser as well, instead of pulling it from a CDN. To me this branch looks good to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/setup-globals.js
Outdated
@@ -19,6 +19,7 @@ global.window.tinyMCEPreInit = { | |||
}; | |||
window.requestAnimationFrame = setTimeout; | |||
window.cancelAnimationFrame = clearTimeout; | |||
window.matchMedia = () => ( {} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder the extent to which we should try to mimic a proper return value here, i.e. MediaQueryList. This implementation could be problematic if a library using matchMedia
attempted to treat the matches
property on the return object as a boolean (i.e. false === window.matchMedia( '...' ).matches
). Conversely, the value wouldn't be accurate, so we can't provide a useful value anyways. From what I can tell, this should be fine enough for how TinyMCE is using it:
A more thorough stub might look like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Should we adjust it here to something like that comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be an improvement, though in whatever solution we use, the result will be inaccurate at best. The implementation in the comment could at least avoid some strange behavior that could occur when trying to use properties of the return value (e.g. addListener
as a noop at least prevents errors calling undefined as a function)
@@ -119,7 +119,7 @@ export default class Editable extends Component { | |||
editor.on( 'keyup', this.onKeyUp ); | |||
editor.on( 'selectionChange', this.onSelectionChange ); | |||
editor.on( 'BeforeExecCommand', this.maybePropagateUndo ); | |||
editor.on( 'BeforePastePreProcess', this.onBeforePastePreProcess ); | |||
editor.on( 'PastePreProcess', this.onPastePreProcess, true /* Add before core handlers */ ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BeforePastePreProcess
event has been removed.
I updated the |
It probably doesn't make much sense when we're running a more bleeding-edge version than what's used elsewhere in Core, but the general point with aliasing to window globals is to play more nicely with shared dependencies of script loader, rather than potentially including multiple copies of the same dependency on the page by bundling it. |
This will close #1607 |
The placeholder issue is coming from tinymce/tinymce@40ff87c. Maybe we should add a class there after all, but don't really like TinyMCE inserting something outside its node. |
Fix will be released Monday: https://wordpress.slack.com/archives/C0UCMQP0F/p1507294443000422. |
b9a8095
to
de90d7d
Compare
Updated once more: tinymce/tinymce@4.7.0...4.7.1 |
de90d7d
to
a09ba26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated package-lock.json
to latest version. Confirmed previous issue I saw is no longer present. Appears to work well 👍
Sorry, again forgot 🙈 |
Description
This PR updates TinyMCE (4.6.5 to 4.7.1).
Changes: tinymce/tinymce-dist@4.6.5...4.7.1
How Has This Been Tested?
Make sure editable regions work, check things like paste, formatting, block splitting and merging...
Checklist: