Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork388
feat: add support for link preload/prefetch#1043
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
linux-foundation-easyclabot commentedJul 14, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
grybykm commentedJul 25, 2023
@alexander-akait is it ok to merge this one? |
Hi@alexander-akait |
@FogelAI Can you accept CLA? |
]), | ||
"}", | ||
])};` | ||
: "// no preloaded", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Did you copy this code from webpack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, with adjustments to CSS.
Except for thegetLinkElements
function that I added (b785fd8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I want to finish -webpack/webpack#18190, i.e. for built-in CSS support, then I will check code here, regaridng -getLinkElements
, it is an intresting question, because I think browsers make different things -webpack/webpack#17497, we need to report about to chrome bug tracker, if it is a bug, they need to fix it, if not - I will improve our code late
src/index.js Outdated
`}`, | ||
`return loadedLinks;`, | ||
]), | ||
`};`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Let's removegetLinkElements
from here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It will be another investigation
src/index.js Outdated
} = /** @type {Compilation} */ (this.compilation); | ||
const chunkMap = getCssChunkObject( | ||
/** @type {Chunk} */ (chunk), | ||
/** @type {Compilation} */ (this.compilation) | ||
); | ||
const { globalObject } = runtimeTemplate; | ||
const { linkPreload, linkPrefetch } = | ||
JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please put these hooks here, i.e. just copy/paste, because this plugin can work not only with Jsonp, also with ESM modules
This PR contains a:
Motivation / Use-Case
This pull request addswebpackPrefetch and webpackPreload magic comments support of webpack at import() for css files, per this issue:#142.
It is also an alternative realization of#344 and#488 pull requests, which are not merged and are not active.
See alsowebpack/webpack#7056 pull request of webpack repository.
Breaking Changes
No breaking changes.
Additional Info