Closed bryceosterhaus closed 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.
Exclude react and react-dom from the build sizes.
This should be do-able with https://github.com/parcel-bundler/parcel/issues/3305
Most everything has been hashed out by using size-limit
.
Currently we build ever package and get its size. This means we include all dependencies and peer dependencies such as
react
andreact-dom
. Below are a few improvements we can make to add more benefit.react
andreact-dom
from the build sizes. (included in size-limit)clay-css
size-limit
)parcel
.(size-limit
)I am open to more ideas as well, but figured I would start with a handful of items I have been thinking about.