-
Notifications
You must be signed in to change notification settings - Fork 29
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
Only populate the minimum needed assets when doing inline replacement #12
Comments
Given the new v4 API, could such a query be simplified to something like this? {
followRelations: {
crossorigin: false,
to: {
type: ['Html', 'Css', 'Font'] // Not sure the font type exists yet
}
}
} |
We could theoretically pick up references to stylesheets and templates referenced from JavaScript if they're using the |
The list looks complete otherwise. Note that If we add the required features for Regarding Oh, |
It's going to be hard to reason about source order of JS included CSS, and thus also specificity. That will most likely be a large source of errors |
You're right about that. Could argue that we need to dive into executing the code and doing a new trace whenever the DOM mutates to truly cover that case. |
That won't work right now because If we implement the idea we discussed yesterday, the query could look something like: {
followRelations: {
crossorigin: false,
to: [ { Html: true }, { Css: true }, { Font: true } ]
}
} ... which isn't really great either. Maybe we could have a shorthand so that a string matched against an asset means that the asset needs to have a truthy property with that name so it could be: {
followRelations: {
crossorigin: false,
to: [ 'Html', 'Css', 'Font' ]
}
} |
I'm fine with using |
Yeah, I guess this is a good example of why we want to retain the ability to query by asset types. I'm happy assetgraph/assetgraph#793 went in so we don't lose the ability to do that for assets that haven't loaded yet. |
For the record, the new query syntax would be: {
followRelations: {
crossorigin: false,
to: {
type: {
$in: [ 'Html', 'Css', 'Font' ]
}
}
} |
When the assets written back to disk are the original ones there is really no reason to spend time on populating any parts of the dependency graph that don't affect the outcome.
Relations that should be populated include:
HtmlStyle
HtmlAnchor
HtmlIframe
HtmlTemplate
,HtmlConditionalComment
HtmlFrame
HtmlIframe
HtmlIframeSrcDoc
HtmlImport
HtmlInlineScriptTemplate
HtmlNoscript
HtmlScript
? Not sure we can cover JS pathsHtmlStyleAttribute
HtmlSvgIsland
CssImport
CssFontFaceSrc
Did I forget any? Or is this even a sane approach?
+@papandreou
The text was updated successfully, but these errors were encountered: