Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mejiaj
Copy link
Contributor

@mejiaj mejiaj commented Oct 30, 2024

Summary

Removed unused webpack dependency. We're not using the twig-html-loader dependency in uswds or uswds-site. It's been removed to reduce the number of dependencies.

Originated in #5832. Thanks again to @aduth for this contribution.

Breaking change

This is not a breaking change.

Related issue

Closes #6082.

Related pull requests

This is an internal change.

Preview link

Preview link →. There shouldn't be any regressions.

Problem statement

We wanted to confirm there were no regressions here or on uswds-site before removing the dependency. We build twig templates in this repo as part of our CI to ensure there aren't breaking changes to our component previews on site.

Solution

This specific dependency isn't needed and removed to have one less to worry about.

Testing and review

  1. Run npm run build:html
  2. Templates should still work as expected
  3. On uswds-site; checkout branch remove-deps-uswds-6082
  4. Confirm you can install and run locally npm install && npm start
  5. Visit component previews (code included) and confirm there aren't regressions

Dependency updates

Dependency name Previous version New version
twig-html-loader 0.1.9 --

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

LGTM!

  • Builds html-templates directory appropriately
  • Builds component preview HTML on site
  • Builds template HTML on site
  • No references to the removed dependency

Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

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

I installed this branch on uswds-site and received a bunch of Error: Cannot find module 'twig' errors when running npm run build.

Removing the --legacy-peer-deps flag from the gulp build.js file does appear to resolve the errors. (For reference, the flag was added in this commit)

  1. Curious if anyone else encounters these errors on site?
  2. If yes, is it reasonable to remove that flag in the uswds-site repo to make this work?

@mahoneycm
Copy link
Contributor

@amyleadem I didn't notice the error after installing this branch. Looks like it doesn't happen on CI either since the checks passed and the preview built. If you run a clean install before installing this branch, are you still seeing the errors?

@amyleadem
Copy link
Contributor

@mahoneycm Yep, did a clean install. Did you remove the existing site directory before running npm run build on uswds-site?

@mahoneycm
Copy link
Contributor

@amyleadem oh I did not. Removing the directory did cause the build errors you mentioned before. Great catch! Removing --legacy-peer-deps resolved the build errors for me. It looks to me like it'd be a good idea to remove it on site when we install the next release branch

Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

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

Note: @mejiaj highlighted that the --legacy-peer-deps flag has been removed as part of the remove-deps-uswds-6082 test branch and this change should be included in the release. Approving this with the note that we should convert this uswds-site change to a PR that gets published with the other release doc updates.

@mejiaj
Copy link
Contributor Author

mejiaj commented Nov 6, 2024

I've renamed the site branch [remove-deps-uswds-6082] and updated the PR - uswds/uswds-site#2950.

@thisisdano thisisdano merged commit d0722a7 into develop Nov 6, 2024
5 checks passed
@thisisdano thisisdano deleted the jm-remove-deps-6082 branch November 6, 2024 21:29
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.

USWDS - Enhancement: Remove twig-html-loader dependency

5 participants