Skip to content

Conversation

@argilo
Copy link

@argilo argilo commented Oct 10, 2024

YUI Compressor was introduced in 0fabf4d and b7105ca as a means of reducing the number of requests required to render the page. But it has some downsides:

  • YUI Compressor was abandoned about a decade ago, and does not support modern JavaScript syntax.
  • It does not generate source maps, which makes debugging difficult.
  • It requires developers to have Java installed.

Since HTTP/2 is now widely supported and allows separate files to be multiplexed over a single TCP connection, we should be able to remove YUI Compressor and switch back to plain JavaScript without increasing load time.

To avoid the need to insert version information into JavaScript files, I moved the version information into data attributes in index.html's body tag.

Previously, build.sh updated index.html in place, but this made it difficult to work on that file. I renamed index.html to index.template.html, from which index.html is now generated.

The list of cached CSS & JavaScript files in service-worker.js had fallen out of date, so I updated that as well.

@argilo argilo force-pushed the remove-yui-compressor branch from ae43f18 to e00bad3 Compare October 10, 2024 02:46
@argilo argilo force-pushed the remove-yui-compressor branch from e00bad3 to 6138f56 Compare October 10, 2024 03:00
@darksidelemm darksidelemm merged commit 29616aa into projecthorus:testing Oct 10, 2024
@argilo argilo deleted the remove-yui-compressor branch October 15, 2024 00:35
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.

3 participants