Skip to content

Explicitly define module position#17

Merged
thiemowmde merged 1 commit intowikimedia:masterfrom
gi11es:patch-1
Apr 29, 2015
Merged

Explicitly define module position#17
thiemowmde merged 1 commit intowikimedia:masterfrom
gi11es:patch-1

Conversation

@gi11es
Copy link
Copy Markdown
Contributor

@gi11es gi11es commented Apr 28, 2015

Style modules currently added through addModuleStyles default to being in the head ("top" position). This is an unhealthy default, since only critical styles that are needed at pageload should be in the head. In order to be able to switch the default to "bottom", existing module positions have to be defined explicitly.

Bug: T97410

Style modules currently added through addModuleStyles default
to being in the head ("top" position). This is an unhealthy default,
since only critical styles that are needed at pageload should be
in the head. In order to be able to switch the default to "bottom",
existing module positions have to be defined explicitly.

Bug: T97410
@thiemowmde
Copy link
Copy Markdown
Contributor

I think the styles in question in this component can be at the bottom. Wouldn't that be better in terms of performance/page load time?

@gi11es
Copy link
Copy Markdown
Contributor Author

gi11es commented Apr 28, 2015

Indeed, "bottom" would be much better in terms of performance! I highly recommend that you change it to that if you can. But I leave that to the extension maintainers to figure out and test. Since I'm sending changesets for all extensions used in production, it would be too time-consuming to figure that out on my own. It's much less risky for me to write a no-op commit that merely exposes the current state.

Please note that making "bottom" modules added that way actually load at the bottom depends on a changeset I haven't finished yet: https://gerrit.wikimedia.org/r/#/c/206831/ Right now, even if you mark it "bottom" addModuleStyles will put it in the head anyway.

thiemowmde added a commit that referenced this pull request Apr 29, 2015
Explicitly define module position
@thiemowmde thiemowmde merged commit a4cb3fa into wikimedia:master Apr 29, 2015
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.

2 participants