Export just wp-content instead of full WordPress#780
Merged
Conversation
7316553 to
66001e8
Compare
c626cbb to
9d48969
Compare
seanmorris
reviewed
Nov 27, 2023
...ound/blueprints/src/lib/steps/apply-wordpress-patches/wp-content/mu-plugins/0-playground.php
Outdated
Show resolved
Hide resolved
b0ffb5d to
015ece2
Compare
dmsnell
reviewed
Nov 27, 2023
...ound/blueprints/src/lib/steps/apply-wordpress-patches/wp-content/mu-plugins/0-playground.php
Outdated
Show resolved
Hide resolved
dmsnell
reviewed
Nov 27, 2023
...ound/blueprints/src/lib/steps/apply-wordpress-patches/wp-content/mu-plugins/0-playground.php
Show resolved
Hide resolved
dmsnell
reviewed
Nov 27, 2023
| }); | ||
| </script> | ||
| <?php | ||
| }); |
Member
There was a problem hiding this comment.
is there enough of a warrant to move this into the service worker? or would that leave out CLI Playgrounds?
or perform it on render output from PHP to ensure that we don't miss it?
Collaborator
Author
There was a problem hiding this comment.
This is only relevant for the web version so you're on to something here.
The main challenge with doing it outside of WordPress, like in the service worker or the PHP rendering pipeline, is deciding whether the output is meant to be a document displayed by the browser. There may be static HTML files, XHR queries, HTML-like files, CSS files, binary blobs etc, but we only ever want to add this code snippet to UI rendered by WordPress.
adamziel
commented
Nov 28, 2023
packages/playground/blueprints/src/lib/steps/import-wp-content.ts
Outdated
Show resolved
Hide resolved
adamziel
added a commit
that referenced
this pull request
Dec 2, 2023
The importFile step, which allows developers to import WordPress content bia WXR and WXZ files, got accidentally removed in Pull Request #780. This commit restores that step. Testing instructions Go to the following localhost URL and confirm the WordPress reflects the non-standard content it imported from WordPress theme unit tests data: http://localhost:5400/website-server/#{%22steps%22:[{%22step%22:%22login%22},{%22step%22:%22importFile%22,%22file%22:{%22resource%22:%22url%22,%22url%22:%22https://raw.githubusercontent.com/WordPress/theme-test-data/master/themeunittestdata.wordpress.xml%22}}]} In particular, the menu should say twitter.com, facebook.com etc As the Playground codebase starts supporting using WordPress in unit tests, let's add a test case for this step. Closes #833
adamziel
added a commit
that referenced
this pull request
Dec 6, 2023
The importFile step, which allows developers to import WordPress content bia WXR and WXZ files, got accidentally removed in Pull Request #780. This commit restores that step. Testing instructions Go to the following localhost URL and confirm the WordPress reflects the non-standard content it imported from WordPress theme unit tests data: http://localhost:5400/website-server/#{%22steps%22:[{%22step%22:%22login%22},{%22step%22:%22importFile%22,%22file%22:{%22resource%22:%22url%22,%22url%22:%22https://raw.githubusercontent.com/WordPress/theme-test-data/master/themeunittestdata.wordpress.xml%22}}]} In particular, the menu should say twitter.com, facebook.com etc As the Playground codebase starts supporting using WordPress in unit tests, let's add a test case for this step. Closes #833
adamziel
added a commit
that referenced
this pull request
Dec 6, 2023
The importFile step, which allows developers to import WordPress content bia WXR and WXZ files, got accidentally removed in Pull Request #780. This commit restores that step. ## Open questions `importFile` sounds ambiguous. What if it was split into two distinct steps called `importWxr` and `importWxz`? Then, the new `importWpFiles` step could be called `importWpContentDirectory` instead. ## Follow-up work The importFile step uses `DOMParser` which isn't available in Node.js. It could, instead: * Call the appropriate import-related PHP functions directly, or... * Use the HTML Tag Processor available in WordPress 6.3+ (and polyfill it in the older WordPress versions). ## Testing Instructions Go to the following localhost URL and confirm the WordPress reflects the non-standard content it imported from WordPress theme unit tests data: http://localhost:5400/website-server/#{%22steps%22:[{%22step%22:%22login%22},{%22step%22:%22importFile%22,%22file%22:{%22resource%22:%22url%22,%22url%22:%22https://raw.githubusercontent.com/WordPress/theme-test-data/master/themeunittestdata.wordpress.xml%22}}]} In particular, the menu should say twitter.com, facebook.com etc As the Playground codebase starts supporting using WordPress in unit tests, let's add a test case for this step. Closes #833 CC @eliot-akira @aplamada
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR modifies the Playground import/export feature to focus on the wp-content directory instead of the entire WordPress installation.
wp-contentdirectory without Playground artifacts like thesqlite-database-integrationplugin or the0-playgroundmu-pluginwp-includes,wp-admin, and thewp-contentdirectories. Thewp-contentdirectory gets a special treatment in that Playground artifacts such as thesqlite-database-integrationand the0-playgroundmu-plugin are restored.Rationale
Exporting the full WordPress from Playground doesn't make much sense. It's an optimized bundle that's missing some files, it locks you in in an outdated WordPress version, and it inflates the zip size. What matters is the
wp-contentdirectory. This should enable easy GitHub-based management of WordPress core feature showcases.Remaining work
Other changes
replaceSitestep. SourceGraph suggests it wasn't used in any public repo 🤞 Use the newimportWordPressFilesstep instead.Testing
wp-contentdirectory