-
Notifications
You must be signed in to change notification settings - Fork 14
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
USWDS-Compile - Dependencies: GulpJS v5 #96
Conversation
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.
- Confirmed that I could successfully perform all the gulp tasks in the uswds-sandbox test branch
- Confirmed that I could successfully perform gulp tasks after installing on uswds-site
- When I installed this branch on uswds-site, I noticed that the fonts no longer rendered correctly (See screenshot below). When I tested reverting the branch to version ^1.1.0, the fonts rendered correctly again.
- Also, noting that to get the gulp
watchSass
task to run without error, I needed to remove gulp 4 from the package.json in the uswds-site repo.
- When I installed this branch on uswds-site, I noticed that the fonts no longer rendered correctly (See screenshot below). When I tested reverting the branch to version ^1.1.0, the fonts rendered correctly again.
- Confirmed the vulnerabilities listed in the PR description are accurate and up-to-date
Follow-up tasks
The documentation on the Phase 2: Compile page specifically mentions to tool using Gulp 4. We should be sure to update that after this PR is merged.
Addresses compression and loading issues in browsers. Example browser errors: - `Failed to decode downloaded font: <URL>` - `OTS parsing error: Failed to convert WOFF 2.0 font to SFNT`
Resolves broken image issue in Cloud Page previews
Resolves 404 issues in Cloud Page previews
@@ -255,6 +261,7 @@ function buildSprite() { | |||
function renameSprite() { | |||
return src(`${paths.dist.img}/usa-icons.svg`.replace("//", "/"), { | |||
allowEmpty: true, | |||
encoding: false |
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.
Note
Didn't notice any difference here. Keeping because SVGs it still following recommendation for removing encoding from images.
I was able to confirm the following issues:
Any help reproducing icon issue would be appreciated. |
return src(`${getSrcFrom("fonts")}/**/**`.replace("//", "/"), { | ||
encoding: false, | ||
}).pipe(dest(paths.dist.fonts)); |
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.
Avoids corruption on images and fonts.
More info here: gulpjs/gulp#2803
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.
Good catch! And thanks for the reference link 👏
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.
This is looking great!
- Previous Sandbox regressions resolved
- Previous Site regressions resolved
- Scripts run without error
- Update resolves a high severity dependency vulnerability
Also noting that I never observed any icon regression that you mentioned being unable to reproduce. All the img regressions I saw were specifically jpg, png, or webp files specifically in the /assets/img/
directory which have since been resolved 👍
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.
Looks good to me! Thanks for your work on this. 👏
In both uswds-site and uswds-sandbox test branches, I was able to confirm:
- Fonts appear to render correctly
- Images appear to render correctly
- No console errors
- Able to successfully run gulp tasks
Also:
- Confirm
return src()
calls in gulpfile.js turn off encoding for images and fonts (thanks for the helpful note, @mejiaj!)
return src(`${getSrcFrom("fonts")}/**/**`.replace("//", "/"), { | ||
encoding: false, | ||
}).pipe(dest(paths.dist.fonts)); |
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.
Good catch! And thanks for the reference link 👏
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.
LGTM 🚀
@mejiaj - Oooh, super important, critical, drop-everything-the-project-is-on-fire change still needs to be made along with this PR... the readme needs to change "Gulp 4" to "Gulp 5"! 😉 |
Is there a timeline for when these changes will also be pushed to the package? |
(I don't have the best info to answer your question, but: hi @angeliquejw! good to "see" you 👋) |
Updating GulpJS from v4 to v5. Closes #99.
Gulp 5 changelog →
Before (develop)
After
Previews
Testing
Possible regressions
Issues with assets and compile
Details
Source →.
Regressions in Sandbox with
copyAssets
andcopyImages
resulting in regressions and corrupted images.1. Missing flag in Site
PR: [test] USWDS-Sandbox - Dependencies: Test USWDS Compile gulp 5
2. Missing icons in Sandbox
Wasn't able to reproduce. Tested with/without encoding in 424d9a4 and 294b40b.
3. Font rendering
Details
Source →
Confirmed in Site and Sandbox. Fonts were corrupted and not rendering correctly on site.
PR: [test] USWDS-Sandbox - Dependencies: Test USWDS Compile gulp 5
PR: [Test] Install uswds-compile w/ gulp 5 - Fixed in 108865f