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

Add support for collectting html inline-style dependencies(#541) #947

Conversation

Fadingvision
Copy link

Add support for collectting html inline-style dependencies.

Fixes(#541)

@codecov-io
Copy link

codecov-io commented Mar 5, 2018

Codecov Report

Merging #947 into master will increase coverage by 5.27%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #947      +/-   ##
==========================================
+ Coverage   87.46%   92.73%   +5.27%     
==========================================
  Files          74       67       -7     
  Lines        3493     2422    -1071     
==========================================
- Hits         3055     2246     -809     
+ Misses        438      176     -262
Impacted Files Coverage Δ
src/assets/HTMLAsset.js 100% <100%> (ø) ⬆️
src/packagers/RawPackager.js 92.85% <0%> (-7.15%) ⬇️
src/HMRServer.js 89.47% <0%> (-2.2%) ⬇️
src/transforms/uglify.js 69.56% <0%> (-2.18%) ⬇️
src/WorkerFarm.js 91.66% <0%> (-1.89%) ⬇️
src/utils/bundleReport.js 69.44% <0%> (-1.61%) ⬇️
src/assets/StylusAsset.js 85.36% <0%> (-1.6%) ⬇️
src/assets/ReasonAsset.js 90.9% <0%> (-1.4%) ⬇️
src/SourceMap.js 57.29% <0%> (-1.3%) ⬇️
src/Server.js 91.66% <0%> (-0.93%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0140dce...f13bd1c. Read the comment docs.

@@ -92,6 +93,24 @@ class HTMLAsset extends Asset {
return newSources.join(',');
}

collectInlineStyleDependencies(inlineStyle) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is very hard to read. Could you try to add comments to make it easier to understand?

Copy link
Author

Choose a reason for hiding this comment

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

just add it in the newest commit.

@@ -92,6 +93,27 @@ class HTMLAsset extends Asset {
return newSources.join(',');
}

collectInlineStyleDependencies(inlineStyle) {
// split inline styles to rule array and filter the non-epmty ones
const styles = inlineStyle
Copy link
Member

Choose a reason for hiding this comment

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

Can we parse the css using a real css parser like postcss to process this rather than implementing our own? Check out how we collect dependencies in the CSSAsset.

@teabyii
Copy link

teabyii commented Mar 31, 2018

Is there any progress in this work?

@Fadingvision
Copy link
Author

sorry for the late response.
@devongovett just updated my pr as you suggested

@devongovett
Copy link
Member

Hey sorry for the delay here. I'm going to close this in favor of #1456 since that passes style attributes through to the existing CSSAsset for full processing along with inline style and script tags. Should handle everything that was done in this PR with less code duplication.

@devongovett devongovett closed this Jul 4, 2018
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

5 participants