-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backfill the assets removed from minified WordPress bundles (#1604)
## Motivation for the change, related issues To achieve [offline support](#1483) we need to download all WordPress files into the Playground filesystem. Today Playground downloads WordPress partially on boot and downloads assets as they are needed using fetch requests. This PR downloads all assets into the Playground filesystem without blocking the boot process. ## Implementation details Zip files are generated using the WordPress build script and are accessible in the `/wp-VERSION/` folder like any other assets. The download is triggered after WordPress is installed. The fetch is async and won't block the boot process. In case some of the assets are needed immediately on boot they will still be downloaded using fetch to ensure they are available to WordPress. Once the assets are downloaded they are stored in the Playground filesystem and will be served from there. ## Testing Instructions (or ideally a Blueprint) - Run `npx nx bundle-wordpress:nightly playground-wordpress-builds` - Confirm that a `packages/playground/wordpress-builds/public/wp-nightly/wordpress-static.zip` file was created - [Load Playground using this blueprint](http://127.0.0.1:5400/website-server/?php=8.0&wp=nightly) - In network tools see that the `wordpress-static.zip` file was downloaded - Open `/wp-admin/` - In network tools confirm that static assets like _thickbox.js_ were loaded from the service worker instead of a fetch --------- Co-authored-by: Adam Zieliński <[email protected]>
- Loading branch information
Showing
14 changed files
with
182 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+11.2 MB
packages/playground/wordpress-builds/public/wp-6.2/wordpress-static.zip
Binary file not shown.
Binary file added
BIN
+11.6 MB
packages/playground/wordpress-builds/public/wp-6.3/wordpress-static.zip
Binary file not shown.
Binary file added
BIN
+12.9 MB
packages/playground/wordpress-builds/public/wp-6.4/wordpress-static.zip
Binary file not shown.
Binary file added
BIN
+12.9 MB
packages/playground/wordpress-builds/public/wp-6.5/wordpress-static.zip
Binary file not shown.
Binary file added
BIN
+12.8 MB
packages/playground/wordpress-builds/public/wp-beta/wordpress-static.zip
Binary file not shown.
Binary file added
BIN
+12.9 MB
packages/playground/wordpress-builds/public/wp-nightly/wordpress-static.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters