[wp-trac] [WordPress Trac] #53437: Widgets Screen: wp.editor.initialize is not a function notice

WordPress Trac noreply at wordpress.org
Thu Jun 17 06:07:51 UTC 2021


#53437: Widgets Screen: wp.editor.initialize is not a function notice
--------------------------+-------------------------
 Reporter:  noisysocks    |       Owner:  noisysocks
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  5.8
Component:  Widgets       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-------------------------

Comment (by noisysocks):

 I added a fix but I'm not particularly happy with it. The problem is that
 when `wp-editor` is loaded it will will assign `wp.oldEditor = wp.editor`
 and then re-define `wp.editor`. This breaks widgets which rely on
 `wp.editor`. The widgets screen doesn't require `wp-editor` but it is
 loaded because it is a dependency of `wp-block-library` and `wp-block-
 directory`.

 We can safely remove `wp-block-directory` as it's not used in the widgets
 screen. (For now.)

 Removing `wp-editor` from `wp-block-library` is more tricky. It's safe to
 remove because only the Classic block uses `wp-editor` and this block is
 disabled in the widgets block editor. Ideally we would split the Classic
 block out of `@wordpress/block-library` so that only parts of WordPress
 which use it (the post editor) can enqueue it. I'm not sure if it's
 sensible to do this during the beta period, though. Instead I'm manually
 remove the `wp-editor` dep from `wp-block-library` which is very hacky.

 @gziolo: I'd appreciate your guidance here. What do you think we should
 do?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53437#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list