liferay / clay

A web implementation of the Lexicon Experience Language
http://clayui.com
Other
208 stars 483 forks source link

Improvements for package build stats GH action #3001

Closed bryceosterhaus closed 4 years ago

bryceosterhaus commented 4 years ago

Currently we build ever package and get its size. This means we include all dependencies and peer dependencies such as react and react-dom. Below are a few improvements we can make to add more benefit.

I am open to more ideas as well, but figured I would start with a handful of items I have been thinking about.

jbalsas commented 4 years ago

Just as a reminder of something we did in the past... not saying we should do this, but just in case.

In 2.x we created a clay package that acted as a wrapper of all-things-clay. See https://github.com/liferay/clay/blob/2.x/packages/clay/src/clay.js

This allowed us to recommend a fairly basic initial setup such as:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/clay/lib/css/atlas.css">
<script src="https://cdn.jsdelivr.net/npm/clay/lib/js/clay.js"></script>

Not sure when that file was last updated or if it has everything... but it currently sits at 576Kb and should contain everything we need to run an app using anything from Clay 2.x.

I feel a similar approach would be a fair initial baseline and properly reflects the max footprint you take on when you want to use Clay.

As @wincent mentions, the way we recommend consuming Clay 3.x is different, so devs are most likely not going to hit that ceiling, but any effort towards lowering it would in turn result in a performance improvement somewhere.

bryceosterhaus commented 4 years ago

Exclude react and react-dom from the build sizes.

This should be do-able with https://github.com/parcel-bundler/parcel/issues/3305

bryceosterhaus commented 4 years ago

Most everything has been hashed out by using size-limit.