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

Avoid adding duplicate modules when importing forwarded stylesheets #973

Merged
merged 2 commits into from Mar 24, 2020

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Mar 24, 2020

In Google stylesheets that imported import-only stylesheets with many
forwards many of times, we were seeing Environment._globalModules grow
large enough that variable accesses were a problem. This addresses
that in several ways:

  • Forwarded modules are now ignored if the module is already being
    forwarded.

  • Module equality is more intelligent, so that shadowed and forwarded
    modules can be effectively de-duplicated.

  • If a module would be fully shadowed by a later import and that
    module has no CSS, we no longer add an empty ShadowedModule to the
    module list.

@nex3 nex3 requested a review from Awjin March 24, 2020 01:37
@nex3 nex3 force-pushed the efficient-module-import branch 2 times, most recently from e3d8ad8 to c76197b Compare March 24, 2020 02:04
In Google stylesheets that imported import-only stylesheets with many
forwards many of times, we were seeing Environment._globalModules grow
large enough that variable accesses were a problem. This addresses
that in several ways:

* Forwarded modules are now ignored if the module is already being
  forwarded.

* Module equality is more intelligent, so that shadowed and forwarded
  modules can be effectively de-duplicated.

* If a module would be fully shadowed by a later import *and* that
  module has no CSS, we no longer add an empty ShadowedModule to the
  module list.
Copy link
Contributor

@Awjin Awjin left a comment

Choose a reason for hiding this comment

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

LGTM

@nex3 nex3 merged commit bf35513 into master Mar 24, 2020
@nex3 nex3 deleted the efficient-module-import branch March 24, 2020 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants