#30229: inlines.min.js contains an unnecessary polyfill
-------------------------------------+-------------------------------------
     Reporter:  djw                  |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * stage:  Unreviewed => Ready for checkin


Comment:

 Dan's explanation of why adding `rewrite_polyfills=false` to `compress.py`
 is okay:

 The parameter's badly-named, but it controls whether polyfills are added
 to the code when the compiler detects that ES6+ features are being used.

 In this case, it thinks Array.prototype.find is being used, which is an
 ES2015 feature, and isn't available in all browsers. The polyfill code
 will add an implementation for browsers which don't have a native
 implementation.

 Django's inlines.js only uses jQuery's .find() method, so this polyfill is
 unnecessary.

 It's possible that in future we'd want to rewrite Django's JavaScript code
 using more modern syntax, which might require the use of polyfills.
 However, I in that case I think it would be preferable to add those
 libraries explicitly, rather than have them added during minification.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30229#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.a8fb41ff259ec1d87742fa95cadbbe39%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to