hassio-addons / addon-tasmoadmin

TasmoAdmin - Home Assistant Community Add-ons
https://addons.community
MIT License
223 stars 31 forks source link

⬆️ Upgrades TasmoAdmin to v4.0.1 #381

Closed inverse closed 6 months ago

inverse commented 7 months ago

Proposed Changes

The major version bump is because of the frontend buildchain change which now has an npm build which takes care of everything.

Comes with the added bonus of not needing to include node_modules which brings the whole image down in size too!

tasmoadmin                                 before               baec78957941   About a minute ago   208MB
tasmoadmin                                 after                dec6ecd71462   3 minutes ago        182MB

Still seems quite big? I guess we could change the base image to be just vanilla alpine?

Tested by copying into my addon on my local instance and running there and all seems working from testing.

Related Issues

(Github link to related issues or pull requests)

frenck commented 7 months ago

Still seems quite big? I guess we could change the base image to be just vanilla alpine?

I think it is fairly OK?

CleanShot 2024-02-05 at 22 44 07@2x

The biggest chunk/layer is 116Mb, which is the official upstream node base images I've started using. (Mostly because I have too, as the shipped NodeJS by Alpine Linux will not build on armv7 due to a QEMU bug).

Looking at pure the add-on itself, it adds 31MB, of which about 6.9MB is for TasmoAdmin (including all assets and vendored libraries), and 24MB is basically the PHP and its dependencies.

What could be done, is building using the NodeJS base image in the first state, copy the www folder over from the second stage using the generic add-on base image.

This assumes the NodeJS runtime isn't used @ the normal add-on lifetime.

inverse commented 7 months ago

Thanks for explaining! Yeah it sounds like using the node image as the build environment and copying out could be a good solution.

frenck commented 7 months ago

I'm not fully understanding why this one is stuck on armv7

inverse commented 6 months ago

Do you think it could be to do with now using esbuild?

https://github.com/evanw/esbuild/issues/1556

inverse commented 6 months ago

I guess we can use the release artifacts as they include the assets already compiled

inverse commented 6 months ago

Closing this in favour of #389 which should work as the frontend assets will be prebuilt.

Then I guess #383 could be tested and things should just work.