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($core): no dynamic import style #1490

Merged
merged 1 commit into from
Apr 25, 2020
Merged

Conversation

shigma
Copy link
Collaborator

@shigma shigma commented Mar 29, 2019

Summary

VuePress will create an empty chunk every time.

repro: https://github.com/Shigma/vuepress-generates-empty-chunk

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@timaschew
Copy link
Contributor

What do you mean with empty chunk? I don't see empty chunks in https://github.com/Shigma/vuepress-generates-empty-chunk/tree/master/.vuepress/dist
Or do you expect to have an empty chunk with this change?

Copy link
Member

@ulivz ulivz left a comment

Choose a reason for hiding this comment

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

Good job, and could you help confirm following 2 things:

  1. Whether the generated CSS styles satisfies the following sequence - ref:
    • Theme's styles
    • User's styles
  2. The underlying causes of generating this empty chunk.

@shigma
Copy link
Collaborator Author

shigma commented Mar 30, 2019

@ulivz

  1. I have tested the overriding behavior by using the following test codes:

//.content {
// font-size 30px;
//}

And it works as expected.

  1. Dynamic imports is a part of code splitting.

@shigma
Copy link
Collaborator Author

shigma commented Apr 28, 2019

@ulivz Can you look into this PR one more time?

@flozero
Copy link
Collaborator

flozero commented Sep 5, 2019

hello @shigma i know it's been a while. But can you tell me more about your PR. What about the empty chunks stuff.

I think about the generation of them. It's look great but i am not sure to understand

@flozero flozero added type: enhancement Request to enhance an existing feature need feedback Awaiting author response status: awaiting more context Need more context about this issue version: 1.x Relates to version 1 of VuePress complexity: hard Hard complexity labels Sep 5, 2019
@Mister-Hope
Copy link
Contributor

Mister-Hope commented Apr 15, 2020

Can we have this PR merged? I think it is using the improt function which the webpack provides now, and he is changing it to es module syntax. So it will fix the empty chunk issue. @f3ltron

@shigma
Copy link
Collaborator Author

shigma commented Apr 18, 2020

@f3ltron

import() will be interpretted as dynamic import, which means the file it imports should be emitted in a separate file.

@Mister-Hope
Copy link
Contributor

@newsbielt703 @meteorlxy Could you check and merge this PR. Quite a long time since Shigma opened it.

@billyyyyy3320
Copy link
Collaborator

LGTM! One more approval and it will be merged.

@meteorlxy meteorlxy merged commit c80c36b into master Apr 25, 2020
@meteorlxy meteorlxy deleted the no-dynamic-import-style branch April 25, 2020 13:06
@shigma
Copy link
Collaborator Author

shigma commented Apr 28, 2020

Glad to see this merged. Thanks!

larionov pushed a commit to larionov/vuepress that referenced this pull request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: hard Hard complexity need feedback Awaiting author response status: awaiting more context Need more context about this issue type: enhancement Request to enhance an existing feature version: 1.x Relates to version 1 of VuePress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants