Remove pre-built files from the repository
There are some pre-built files shipped in the build directory:
-
wp-admin -
wp-content -
wp-includes -
wp.js -
wp.data -
php.wasm -
php-web.js -
php-webworker.js
Building them from scratch requires additional setup and takes a long time, which is a bad experience for a new contributor who just wants to clone the project and publish their first PR.
At the same time, shipping these files is a burden – they change, pollute the commit logs, and won't play very well with a support for multiple PHP and WordPress version.
It would be nice to have a separate package (or maybe even a repository?) for these pre-built binaries, and source them from there on the initial build.
The GitHub feature called Releases seems suitable for pre-built binaries.
Create a release to package software, along with release notes and links to binary files, for other people to use.
Releases are deployable software iterations you can package and make available for a wider audience to download and use.
Releases are based on Git tags, which mark a specific point in your repository's history.
https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
The documentation shows a manual step to create a release with release note and attached files. But I'm pretty sure I've seen repos that publish releases using GitHub Actions. These actions are run in Docker containers (or something similar), so it's probably possible to build artifacts on every tag - and maybe even automatically make a release.
Puppeteer, the npm package, downloads the correct Chrome build on the first use. Similarly, this repo could ship with no wasm files but npm run dev would download the latest Github Release on the first use.
@gziolo also noticed the build pipeline could be handled by GitHub tasks similarly as in Gutenberg repo. He also said that nx has a paid "global build cache" feature.
Puppeteer, the npm package, downloads the correct Chrome build on the first use. Similarly, this repo could ship with no
wasmfiles butnpm run devwould download the latest Github Release on the first use.
We could also use postinstall script if that makes sense.
@gziolo also noticed the build pipeline could be handled by GitHub tasks similarly as in Gutenberg repo. He also said that
nxhas a paid "global build cache" feature.
I see now that they have a special program for OSS projects. From their website at https://nx.app/pricing#open-source:
Free for OSS! Get full access to all of the features for your project by dropping us a line, with the link to your repository and a description.