[wp-trac] [WordPress Trac] #45535: Unminified react and react-dom

WordPress Trac noreply at wordpress.org
Wed Dec 19 02:17:39 UTC 2018


#45535: Unminified react and react-dom
---------------------------+------------------------------
 Reporter:  emilushi       |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  5.0
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  javascript
---------------------------+------------------------------
Changes (by earnjam):

 * keywords:  needs-patch =>


Comment:

 So it's not clear to me what the determination is between when to use
 `$suffix` vs `$dev_suffix` on any given script, however in
 [attachment:"45535.diff"] I simply switched to following the normal use of
 `$suffix`, which allows it to check `SCRIPT_DEBUG` value first and then
 falls back to checking for `-src` in the WP version.

 This is particularly helpful when developing with React, which otherwise
 shows minified errors and requires you to click to visit reactjs.org for
 the full error messages.

 I'm not sure why we don't just honor `SCRIPT_DEBUG` and then fall back to
 `-src` for all scripts. It appears this change was first introduced in
 [27170], but I couldn't find any discussion around why and it seems
 scripts included in core are split between the two suffix options to
 follow.

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


More information about the wp-trac mailing list