Skip to content
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

fix: modules duplicated in multiple chunks now are always loaded by runtime.js #7856

Closed
wants to merge 24 commits into from

Conversation

maunier
Copy link

@maunier maunier commented Aug 5, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Here is the issue: vuejs/vue#11560
Sorry I have maken the issue at wrong place.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@pi0 pi0 requested a review from clarkdo August 5, 2020 08:33
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2020

Codecov Report

Merging #7856 into dev will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #7856      +/-   ##
==========================================
+ Coverage   68.88%   68.89%   +0.01%     
==========================================
  Files          90       90              
  Lines        3840     3839       -1     
  Branches     1038     1037       -1     
==========================================
  Hits         2645     2645              
  Misses        971      971              
+ Partials      224      223       -1     
Flag Coverage Δ
#unittests 68.89% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/webpack/src/plugins/vue/client.js 3.70% <0.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c30499d...179ef35. Read the comment docs.

Copy link
Member

@clarkdo clarkdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the only change removing m.chunks.length === 1 ?

@maunier
Copy link
Author

maunier commented Aug 5, 2020

Is the only change removing m.chunks.length === 1 ?

Yes

@clarkdo
Copy link
Member

clarkdo commented Aug 5, 2020

This plugin is cloned from vue, so would you mind opening an issue there ? https://github.com/vuejs/vue/blob/4dec3b52c9b71f816e6b86d42ea53e9f2e559646/src/server/webpack-plugin/client.js#L40

I think introducing multiple chunks may need more analyse and data processing, I'll take a deep look about the change.

@maunier
Copy link
Author

maunier commented Aug 5, 2020

This plugin is cloned from vue, so would you mind opening an issue there ? https://github.com/vuejs/vue/blob/4dec3b52c9b71f816e6b86d42ea53e9f2e559646/src/server/webpack-plugin/client.js#L40

I think introducing multiple chunks may need more analyse and data processing, I'll take a deep look about the change.

ok, thanks

@clarkdo
Copy link
Member

clarkdo commented Aug 5, 2020

BTW, can you please provide me a minimal reproduciable repo about this issue ?

@maunier
Copy link
Author

maunier commented Aug 5, 2020

BTW, can you please provide me a minimal reproduciable repo about this issue ?

Yes: https://github.com/maunier/test-vue-ssr.git

}

// Find all asset modules associated with the same chunk
assetModules.forEach((m) => {
Copy link

@galvez galvez Aug 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maunier Any reason not to use for..of here, to keep consistency with the rest of the code?

@pi0 pi0 unassigned maunier Sep 2, 2020
@pi0 pi0 added the pending label Sep 2, 2020
@pi0
Copy link
Member

pi0 commented Sep 2, 2020

@clarkdo is investigating more but it is probably not going to merged. BTW thanks for PR @maunier ❤️

@pi0
Copy link
Member

pi0 commented Nov 30, 2020

Hi @maunier Testing repro (https://github.com/maunier/test-vue-ssr.git) with fresh lock-file seems everything is right.

chunks:

../server/client.manifest.json   6.31 KiB          [emitted]              
                    020e051.js  370 bytes    3, 5  [emitted] [immutable]  pages/c2
                    54aff81.js    155 KiB       1  [emitted] [immutable]  commons/app
                    638c457.js   49.5 KiB       0  [emitted] [immutable]  app
                    71a0567.js  478 bytes       2  [emitted] [immutable]  pages/c1
                      LICENSES  389 bytes          [emitted]              
                    cb2fd46.js   2.32 KiB       4  [emitted] [immutable]  runtime
                    eebef40.js  334 bytes       5  [emitted] [immutable]  

client.manifest.json:

  "async": [
    "020e051.js", <-- pages/c2
    "71a0567.js", <-- pages/c1
    "eebef40.js"
  ],

server.manifest.json:

{
  "entry": "server.js",
  "files": {
    "3.js": "3.js",
    "pages/c1.js": "pages/c1.js",
    "pages/c2.js": "pages/c2.js",
    "server.js": "server.js"
  },
  "maps": {
    "3.js": "3.js.map",
    "pages/c1.js": "pages/c1.js.map",
    "pages/c2.js": "pages/c2.js.map",
    "server.js": "server.js.map"
  }
}

Also pages are preloaded when locally testing.

I believe this fixed with 2.14.5 / #8012

@pi0 pi0 closed this Nov 30, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants