Skip to content

Detect if a link[rel=stylesheet] has been SSR'd/installed for an extension#36865

Merged
erwinmombay merged 6 commits intoampproject:mainfrom
erwinmombay:detect-link-rel-stylesheet
Nov 10, 2021
Merged

Detect if a link[rel=stylesheet] has been SSR'd/installed for an extension#36865
erwinmombay merged 6 commits intoampproject:mainfrom
erwinmombay:detect-link-rel-stylesheet

Conversation

@erwinmombay
Copy link
Copy Markdown
Member

Some amp optimizers will in the future add a link[rel=stylesheet] for an
extension to improve their performance. We need to be able to detect and
not overwrite the installed styles by the external stylesheet.

Copy link
Copy Markdown
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

I believe we're going to have some issues with the styleLoaded function in this file. At the moment, I don't believe it'll ever resolve?

@erwinmombay
Copy link
Copy Markdown
Member Author

erwinmombay commented Nov 10, 2021

@jridgewell is it because you're saying the css url is incorrect right? so i double checked it and earlier didn't even have an actual css anywhere (i just gave it an href that wasn't valid) and it still resolved properly. let me double check everything though

Screen Shot 2021-11-09 at 4 40 21 PM

Copy link
Copy Markdown
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

Ha, apparently stylesheet.ownerNode === link is perfectly fine.

@erwinmombay
Copy link
Copy Markdown
Member Author

@jridgewell thanks. i'll add a comment on that line that style there an refer to both a style element and link element

@erwinmombay erwinmombay force-pushed the detect-link-rel-stylesheet branch from 598537b to aed527e Compare November 10, 2021 01:54
…nsion

Some amp optimizers will in the future add a link[rel=stylesheet] for an
extension to improve their performance. We need to be able to detect and
not overwrite the installed styles by the external stylesheet.
@erwinmombay erwinmombay force-pushed the detect-link-rel-stylesheet branch from aed527e to b856705 Compare November 10, 2021 05:49
@erwinmombay
Copy link
Copy Markdown
Member Author

@jridgewell would you mind approving again when you get a chance was having problems with bundle-size

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.

3 participants