Bug 176227 - Speedometer: Reduce duplication in react-redux test
Summary: Speedometer: Reduce duplication in react-redux test
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 172339
  Show dependency treegraph
 
Reported: 2017-09-01 09:28 PDT by Mathias Bynens
Modified: 2017-09-27 12:45 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.86 MB, patch)
2017-09-07 10:03 PDT, Mathias Bynens
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Bynens 2017-09-01 09:28:43 PDT
The generated bundle includes the same `Object.assign` polyfill five or six times.

In the source code, we’re using object spread in six different places:

    $ grep -r '{\.\.\.' src
    src/components/Footer.spec.js:  renderer.render(<Footer {...props} />)
    src/components/Header.spec.js:  renderer.render(<Header {...props} />)
    src/components/MainSection.js:            <TodoItem key={todo.id} todo={todo} {...actions} />
    src/components/MainSection.spec.js:  renderer.render(<MainSection {...props} />)
    src/components/TodoItem.spec.js:    <TodoItem {...props} />
    src/components/TodoTextInput.spec.js:    <TodoTextInput {...props} />

At build time, Babel transpiles this down to `Object.assign`, relying on the polyfill.

We should find out why the polyfill is not deduplicated correctly.
Comment 1 Mathias Bynens 2017-09-07 10:03:42 PDT
Created attachment 320122 [details]
Patch
Comment 2 Addy Osmani 2017-09-07 10:16:39 PDT
It appears with the latest patch that the problem is no longer an issue (react-scripts may have discovered upstream that there were dupes caused by their build pipeline). The changes in the latest work here LGTM. Deferring to Ryosuke.
Comment 3 Ryosuke Niwa 2017-09-10 17:28:22 PDT
Safari 10.1.2 (12603.3.8)

Patched:
35.0 ± 0.71
33.4 ± 1.0
35.2 ± 1.4
34.8 ± 0.8
36.4 ± 1.1
35.9 ± 0.77

Unpatched:
33.3 ± 2.6
35.4 ± 0.99
35.5 ± 0.84
36.0 ± 0.99
35.5 ± 2.4
35.3 ± 0.66

Chrome 61.0.3163.79

Patched:
44.6 ± 1.5
43.8 ± 1.6
41.0 ± 3.2
43.5 ± 1.9
43.7 ± 1.8
44.7 ± 1.3

Unpatched:
43.8 ± 3.7
44.1 ± 1.5
46.3 ± 1.8
45.6 ± 1.6
46.3 ± 2.4
45.5 ± 1.4
Comment 4 Ryosuke Niwa 2017-09-10 17:29:08 PDT
Comment on attachment 320122 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2017-09-10 18:01:02 PDT
Comment on attachment 320122 [details]
Patch

Clearing flags on attachment: 320122

Committed r221841: <http://trac.webkit.org/changeset/221841>
Comment 6 WebKit Commit Bot 2017-09-10 18:01:03 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2017-09-27 12:45:41 PDT
<rdar://problem/34693898>