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

Webpack 5 + favicons #39

Merged
merged 24 commits into from
Jul 18, 2022
Merged

Webpack 5 + favicons #39

merged 24 commits into from
Jul 18, 2022

Conversation

TomTirapani
Copy link
Member

@TomTirapani TomTirapani commented Mar 7, 2022

Uses a custom plugin to replace the manifest.json generation that was bundled with favicons-webpack-plugin. Allows apps to either:

  • Have a single favicon file embedded in the html. This should be sufficient for most desktop only apps expected to run in modern browsers.
  • Include the favicon variants required for mobile "standalone" apps included in the manifest.json (from https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs). Note that this requires the developer to provide the variously sized favicons manually - I think this is a relatively straightforward, one-time operation.

TomTirapani and others added 9 commits March 8, 2022 17:20
+ Remove a few outdated options, including some internal checks to maintain backwards compat with older versions of Hoist.
+ Look for supported favicon files and build manifest icons array if they exist. Same with apple-touch-icon. Log discovered icons to help make visible.
+ Quiet chatty dev-server logging (infrastructureLog)
+ Use fork of dupe pkg checker w/WP5 support, avoid deprecation warning
+ Include just-released @xh/eslint-config v4
@amcclain
Copy link
Member

I spent a while looking at this today - eager to get it in.

Made some updates - please review when you have a chance. Note there's a commit or two on the hoist-react branch also related to removing some backwards compat stuff.

The next-up mystery for me are these newly specific chunk names - I really want to look over what we are doing here and determine what has changed and if our approach to splitting out and then including these chunks still makes sense. Note that highlighted names are just some of the differences - you can see there are a number of files that no longer have app name in title and instead have specific HR files, etc. (Difficult to type in a comment - look closely and compare w/current build you will see whaat I mean)

New build:
Screen Shot 2022-03-16 at 6 09 49 PM

Prev build:
Screen Shot 2022-03-16 at 6 13 54 PM

@TomTirapani
Copy link
Member Author

TomTirapani commented Mar 17, 2022

Your changes look great Anselm! Especially nice to have the script find and include those standard favicons automatically.

Will look at the chunk names above. What tool are you using there to get the list?

Also, I noticed that after updating the @xh/eslint-config, we're getting loads of linter errors from hoist-react / toolbox around indentation. Will want to look at exactly what's changed there, and if we want to adjust the rules so that it settles down a bit.

Screenshot 2022-03-17 at 11 03 33

@TomTirapani
Copy link
Member Author

Regarding the ESLint issue:

With ESLint 8, it now reports an indentation error on any property / method that uses decorators: eslint/eslint#15299. That's a significant part of our codebase!

Unfortunately, it sounds like the maintainers of the ESLint plugin that babel uses to handle experimental features like decorators will not have the bandwidth to fix it any time soon: typescript-eslint/typescript-eslint#1824.

Should we roll back the @xh/eslint-config release? Was there an important motivation for upgrading to ESLint 8, or was it just a case of wanting to stay current?

@amcclain
Copy link
Member

As we discussed a few minutes ago on chat (for the record):

  • Don't know how I missed that esLint issue - thought I had successfully run the latest against TB and HR but clearly not. We can leave HDU on the prior v3 and revisit the new version if/when there is any improvement. I can add a note to the changelog on the eslint-config project to indicate that it's problematic.
  • Bundle listing was from the left-docked detail panel on the treemap displayed by buildAndAnalyze - we plan to look again closely at our strategy here around chunk names and see if we can make some incremental improvements to clarify the situation and ensure we're still getting the assets we actually need/expect across the different app entrypoints.

@TomTirapani
Copy link
Member Author

Okay - I spent far too long on this, but I was able to significantly simplify our chunk naming & inclusion logic. Now, we've taken control of the naming to ensure that chunks are again named according to the delimited list of entry points that use them. Secondly, I've switch the logic to focus on inclusion rather than exclusion, which hopefully should be simpler to understand.

@amcclain amcclain self-requested a review March 25, 2022 14:18
@amcclain amcclain self-assigned this Mar 25, 2022
@amcclain
Copy link
Member

With ESLint 8, it now reports an indentation error on any property / method that uses decorators: eslint/eslint#15299. That's a significant part of our codebase!

This workaround appears to clear up this issue and all the warnings it generates. I believe it effectively disables indent checking on all class properties (or something like that), but I am not too worried about that.

xh/eslint-config@689829a

@amcclain amcclain merged commit 504a215 into develop Jul 18, 2022
@amcclain amcclain deleted the webpack5Favicons branch July 18, 2022 18:46
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.

2 participants