Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Stored Playgrounds (no more data loss), multiple Playgrounds, UI WebApp Redesign #1731

Merged
merged 128 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
cddec5e
Bring in a router and ensure site-slug is always present in the URL
adamziel Sep 5, 2024
dad4104
Move Playground boot to an isolated component that responds to URL pa…
adamziel Sep 5, 2024
1549065
Temporarily rename "browser" storage to "opfs". TODO: Rename it back
adamziel Sep 5, 2024
60a7465
Fix sidebar navigation
adamziel Sep 5, 2024
d25b5e6
Store Playground client in the redux store
adamziel Sep 5, 2024
6bb40a4
Get initial Playground boot to work
adamziel Sep 5, 2024
9158c0b
Use the correct OPFS mount handle when booting
adamziel Sep 5, 2024
51d5abf
Remove siteViewRef
adamziel Sep 5, 2024
7d4726c
Display the initial selected site info in the site manager
adamziel Sep 5, 2024
f211db9
Rip out PlaygroundContext
adamziel Sep 5, 2024
9e5ad4a
Remove unnecessary useCallback usage
brandonpayton Sep 6, 2024
1dcb88e
Get rid of useNavigatorParams
brandonpayton Sep 6, 2024
6c21093
Stop using the Navigator component
brandonpayton Sep 6, 2024
126bcdf
Use usePlaygroundClient where reasonable
brandonpayton Sep 6, 2024
c836577
Fix setting initial client info
brandonpayton Sep 6, 2024
4fa44dd
Add a TODO to fix logs being shared across sites
brandonpayton Sep 6, 2024
50e4bd6
Avoid re-rendering JustViewport when the site manager is expanded
adamziel Sep 6, 2024
b054876
store opfs mount descriptor with the current client info, not as a
adamziel Sep 6, 2024
b833a3e
Rename addSite to createSite and removeSite to deleteSite
adamziel Sep 6, 2024
1aec606
Adjust the TODO comment
adamziel Sep 6, 2024
c406b66
Only execute the Blueprint on the first site boot. Never execute a Bl…
adamziel Sep 6, 2024
51aac0b
Load the most recently created site when no slug is present (instead …
adamziel Sep 6, 2024
6251c89
Add another todo to JustViewport
adamziel Sep 6, 2024
8dcdfdc
Fix the Add Site button
adamziel Sep 6, 2024
1ad41dd
Remove the `?storage` query arg. Use ?site-manager as a feature flag.
adamziel Sep 6, 2024
588900f
Replace all query args when navigating between sites.
adamziel Sep 6, 2024
488f7a9
Reduce type proliferation: use the partial Blueprint type to store th…
adamziel Sep 6, 2024
4f00aa0
Add a TODO
adamziel Sep 6, 2024
1a69968
Make SiteMetadata a field on SiteInfo instead of using inheritance
adamziel Sep 6, 2024
746dc23
Implement the "Save this site" button
adamziel Sep 6, 2024
e554fad
Inline onAddSite
adamziel Sep 6, 2024
45c9007
Decouple saving site to OPFS
adamziel Sep 7, 2024
e656467
Explore a local-fs save button
adamziel Sep 7, 2024
6160e60
Stop gating site-manager
brandonpayton Sep 7, 2024
f61a7b6
Explain why we use a worker to write to OPFS
brandonpayton Sep 7, 2024
1b73682
Store Local FS site metadata in OPFS
adamziel Sep 7, 2024
7f0e84e
Display local directory name in site info panel
adamziel Sep 7, 2024
b42eb63
Add a rudimentary AddSiteForm for the new modal
adamziel Sep 7, 2024
1e10f85
Actually create new sites via the Add Site Form
adamziel Sep 7, 2024
1af4424
Navigating to temporary sites restores the original URL used to creat…
adamziel Sep 7, 2024
b4b70bb
Make the temporary site notice non dismissible
adamziel Sep 7, 2024
49d18d2
Remove the old site settings modal
adamziel Sep 7, 2024
e85b14a
Add "language" select when creating a site
adamziel Sep 7, 2024
5a46d08
Edit site settings form
adamziel Sep 7, 2024
6f86ea1
Avoid redux serialization warning for updateClientInfo action
brandonpayton Sep 8, 2024
10c0f40
Tweak local-fs site config-saving after conflicting changes
brandonpayton Sep 8, 2024
ce42039
Handle site update operation
adamziel Sep 9, 2024
99f8e6b
Add Multisite checkbox to the site creation modal
adamziel Sep 9, 2024
d6771f7
Move hamburger menu inside the SiteView
adamziel Sep 9, 2024
795bf8e
Restore the delete site icon
adamziel Sep 9, 2024
a4b0092
"Duplicate" -> "Duplicate Site"
adamziel Sep 9, 2024
202676e
Inline the SiteView component
adamziel Sep 9, 2024
c8c43b8
Remove the old Playground Configuration Group component
adamziel Sep 9, 2024
7c95df2
Extract the temporary site notice into a separate component, open the…
adamziel Sep 9, 2024
337355c
Fix property merging in createNewSiteInfo()
adamziel Sep 9, 2024
b68c984
Design adjustments
adamziel Sep 9, 2024
0a5d313
Improve design of the site settings modal, use correct language codes
adamziel Sep 9, 2024
19e0346
Responsive interactions
adamziel Sep 10, 2024
66ff550
Responsiveness
adamziel Sep 10, 2024
ff083af
Navigation buttons in mobile sidebar
adamziel Sep 10, 2024
00f2ff7
Another batch of responsive design changes
adamziel Sep 10, 2024
a0646f1
Responsive navigation buttons and animations
adamziel Sep 10, 2024
e0c9690
Design updates: Updated labels, margins, placements
adamziel Sep 10, 2024
3ecbb64
Fix react warnings
adamziel Sep 10, 2024
4d63af7
Use dropdown V2 for site saving options
adamziel Sep 10, 2024
2400ba3
Cleanup OPFS storage API
adamziel Sep 10, 2024
6961270
Remove OPFSHelper class
adamziel Sep 10, 2024
c14e586
Reorganize state management files
adamziel Sep 10, 2024
5fa8b31
Split redux store into separate slices
adamziel Sep 10, 2024
e7c1839
Extract bootSiteClient to a separate thunk
adamziel Sep 10, 2024
1088758
Persist site updates to OPFS at redux level
adamziel Sep 10, 2024
b96a09e
Update local-fs sites metadata on redux store update
adamziel Sep 10, 2024
caba900
Centralized router
adamziel Sep 10, 2024
d8f3f46
Communicate lack of local FS support in the UI
adamziel Sep 11, 2024
3ae1070
Communicate site boot error messages
adamziel Sep 11, 2024
2fe3a29
Fix TS Types
adamziel Sep 11, 2024
de3ba17
Cleanup all TODOs
adamziel Sep 11, 2024
b7f6a7b
Cleanup one last todo and handle more errors
adamziel Sep 11, 2024
96d5514
Update docs
adamziel Sep 11, 2024
f01ba81
Correctly populate the site edit form for temp sites
adamziel Sep 11, 2024
5e03e90
Axe devtools: Fix the reported problems
adamziel Sep 11, 2024
89e5cdc
Consolidate makeBlueprint and resolveBlueprint
adamziel Sep 13, 2024
09e1205
Preserve or remove the hash when navigating between sites
adamziel Sep 13, 2024
59b1685
Retain temporary sites state even if the user navigates away from them
adamziel Sep 13, 2024
9eb59fa
Handle edge cases: no site selected, no sites available
adamziel Sep 13, 2024
f301903
Simplify EnsurePlaygroundSiteIsSelected to fix boot bugs
adamziel Sep 13, 2024
cce879e
Disable options requiring a site client until the site is booted
adamziel Sep 13, 2024
4255bda
Change language from Site to Playground
adamziel Sep 14, 2024
9f0e676
Merge branch 'trunk' into routing
bgrgicak Sep 16, 2024
ce5ef1d
Fix URL blueprint literal parsing to decode Base64 string
brandonpayton Sep 17, 2024
da9384e
Use structuredClone() to deep clone blueprint
brandonpayton Sep 17, 2024
fe2ce73
Avoid top-level declarations that are only used to initialize other t…
brandonpayton Sep 17, 2024
519e50f
Fix single char typo
brandonpayton Sep 17, 2024
1c1ee48
Remove stale comment
brandonpayton Sep 17, 2024
a4f90f2
Note possibilities for edit/fork existing site
brandonpayton Sep 18, 2024
a8b62c8
Clarify a bit about local FS availability detection
brandonpayton Sep 18, 2024
9df2f79
Add locale list TODO
brandonpayton Sep 18, 2024
0d9af8a
Add sync-local-files-button TODO
brandonpayton Sep 18, 2024
180f6e0
Fix restore-from-zip ARIA label
brandonpayton Sep 18, 2024
20647bd
Remove unused generateUniqueSiteName function
brandonpayton Sep 18, 2024
43d17cc
Allow deletion of broken sites with loading errors
brandonpayton Sep 18, 2024
f45d1c4
Fix saving temporary sites in Safari
brandonpayton Sep 18, 2024
d8d7225
Allow a limited number of concurrent writes in Safari
brandonpayton Sep 18, 2024
6197165
Continue writing files as soon as possible in Safari
brandonpayton Sep 18, 2024
f9831a2
Redirect to the updated site instead of passing a stub
brandonpayton Sep 19, 2024
b16eb95
Restore bug-related TODO until we confirm it is resolved
brandonpayton Sep 19, 2024
387337a
Remove unused siteSlug prop from StartPlaygroundOptions
brandonpayton Sep 19, 2024
092a895
Restore supplemental types needed for FileSystemDirectoryHandle methods
brandonpayton Sep 19, 2024
6169c26
Use createSyncAccessHandle for all browsers because it has been faste…
brandonpayton Sep 21, 2024
f9accc8
Clean up metadata writer worker a bit
brandonpayton Sep 21, 2024
e306b74
Address memfs-to-OPFS performance in Safari
brandonpayton Sep 21, 2024
af97321
Merge branch 'trunk' into routing
brandonpayton Sep 23, 2024
4ac62c3
Make sure all OPFS writes settle before resolving copyMemfsToOpfs()
brandonpayton Sep 23, 2024
27ede18
Expose temp-to-OPFS error to the user
brandonpayton Sep 23, 2024
670d158
Support retrying OPFS save after initial failure
brandonpayton Sep 23, 2024
e2fd6ee
Fix login by default
bgrgicak Sep 17, 2024
a4d6709
Fix default PHP and WP versions
bgrgicak Sep 16, 2024
d6f37ab
Migrate legacy sites to modern sites on-demand
brandonpayton Sep 25, 2024
baeee9d
Merge branch 'trunk' into routing
bgrgicak Sep 26, 2024
0b8b359
Add Playwright tests for UI redesign changes (#1769)
bgrgicak Sep 26, 2024
df2eeb4
Revert "Use createSyncAccessHandle for all browsers because it has be…
brandonpayton Sep 26, 2024
0dcf4ac
Add more log messages for moving legacy OPFS sites
brandonpayton Sep 26, 2024
dc1217d
Speed up saving site to local FS
brandonpayton Sep 27, 2024
568b9a4
Stop overlapping text with long name in site info view
brandonpayton Sep 27, 2024
7e6e7b2
Stop temp site notice from forcing mobile open-site buttons off botto…
brandonpayton Sep 27, 2024
da2fb8d
Make open-site label consistent among site info view buttons
brandonpayton Sep 27, 2024
886648a
More fixes for bottom buttons in mobile site info view
brandonpayton Sep 27, 2024
49f335f
Differentiate between SiteCreateButton and StartSimilarSiteButton
adamziel Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ packages/playground/sync/src/test/wp-*
packages/php-wasm/node/src/test/__test*
*.timestamp-1678999213403.mjs
.local
.vscode
.vscode
playwright-report
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ jobs:
with:
name: cypress-screenshots
path: dist/cypress/packages/playground/website/screenshots

test-e2e-playwright:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
# Run as root to allow node to bind to port 80
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare-playground
- name: Install Playwright Browsers
run: sudo npx playwright install --with-deps
- name: Run Playwright tests
run: sudo CI=true npx nx run playground-website:e2e:playwright:ci
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
build:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ Thumbs.db

# Playground artifacts
php.js.bak
**/test-results/
**/playwright-report/
**/blob-report/
50 changes: 22 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,89 +25,83 @@ The following contributors merged PRs in this release:

### Documentation

- Docs: Better paths for links. ([#1765](https://github.com/WordPress/wordpress-playground/pull/1765))
- Docs: I18n setup. ([#1766](https://github.com/WordPress/wordpress-playground/pull/1766))
- Docs: Remove the outdated "data rependencies" page. ([#1785](https://github.com/WordPress/wordpress-playground/pull/1785))
- Docs: Better paths for links. ([#1765](https://github.com/WordPress/wordpress-playground/pull/1765))
- Docs: I18n setup. ([#1766](https://github.com/WordPress/wordpress-playground/pull/1766))
- Docs: Remove the outdated "data rependencies" page. ([#1785](https://github.com/WordPress/wordpress-playground/pull/1785))

### Website

- Fix troubleshoot-and-debug link. ([#1782](https://github.com/WordPress/wordpress-playground/pull/1782))
- Fix troubleshoot-and-debug link. ([#1782](https://github.com/WordPress/wordpress-playground/pull/1782))

### Various

- Update link for contributor day. ([#1775](https://github.com/WordPress/wordpress-playground/pull/1775))
- Update link for contributor day. ([#1775](https://github.com/WordPress/wordpress-playground/pull/1775))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @juanmaguitar @n8finch


## [v0.9.42] (2024-09-17)
## [v0.9.42] (2024-09-17)

### PHP WebAssembly

- FS: Use the correct rm/rmdir method when moving files between mounts. ([#1770](https://github.com/WordPress/wordpress-playground/pull/1770))
- FS: Use the correct rm/rmdir method when moving files between mounts. ([#1770](https://github.com/WordPress/wordpress-playground/pull/1770))

### Contributors

The following contributors merged PRs in this release:

@adamziel

## [v0.9.41] (2024-09-16)

## [v0.9.41] (2024-09-16)




## [v0.9.40] (2024-09-16)
## [v0.9.40] (2024-09-16)

### Enhancements

- Extend allowable resources available via WordPress/WordPress. ([#1721](https://github.com/WordPress/wordpress-playground/pull/1721))
- Extend allowable resources available via WordPress/WordPress. ([#1721](https://github.com/WordPress/wordpress-playground/pull/1721))

### Tools

- Update actions/upload-artifact version to 4. ([#1748](https://github.com/WordPress/wordpress-playground/pull/1748))
- Update actions/upload-artifact version to 4. ([#1748](https://github.com/WordPress/wordpress-playground/pull/1748))

### Documentation

- Docs/Blueprints resources: Grammar and typo fixes. ([#1741](https://github.com/WordPress/wordpress-playground/pull/1741))
- Docs/Blueprints resources: Grammar and typo fixes. ([#1741](https://github.com/WordPress/wordpress-playground/pull/1741))

### PHP WebAssembly

- @php-wasm/universal : Add Phar support in php-wasm. ([#1716](https://github.com/WordPress/wordpress-playground/pull/1716))
- @php-wasm/universal : Add Phar support in php-wasm. ([#1716](https://github.com/WordPress/wordpress-playground/pull/1716))

### Website

- Add the `components` package with PathMappingControl. ([#1608](https://github.com/WordPress/wordpress-playground/pull/1608))
- Add the `components` package with PathMappingControl. ([#1608](https://github.com/WordPress/wordpress-playground/pull/1608))

### Bug Fixes

- Fix CLI --skipWordPressSetup option. ([#1760](https://github.com/WordPress/wordpress-playground/pull/1760))
- Fix CLI --skipWordPressSetup option. ([#1760](https://github.com/WordPress/wordpress-playground/pull/1760))

### Reliability

- Improve Playground CLI logging and fix quiet mode. ([#1751](https://github.com/WordPress/wordpress-playground/pull/1751))
- Improve Playground CLI logging and fix quiet mode. ([#1751](https://github.com/WordPress/wordpress-playground/pull/1751))

### Various

- Docs/Guides: Guides introductions and some minor adjustments. ([#1754](https://github.com/WordPress/wordpress-playground/pull/1754))
- Docs/Guides: Normalized and fixed guides links. ([#1756](https://github.com/WordPress/wordpress-playground/pull/1756))
- Docs/Guides: Providing content for your demo. ([#1747](https://github.com/WordPress/wordpress-playground/pull/1747))
- Docs/Guides: WordPress Playground for plugin developers. ([#1750](https://github.com/WordPress/wordpress-playground/pull/1750))
- Docs/Guides: WordPress Playground for theme developers. ([#1732](https://github.com/WordPress/wordpress-playground/pull/1732))
- Docs: Links redirections. ([#1758](https://github.com/WordPress/wordpress-playground/pull/1758))
- Docs/Guides: Guides introductions and some minor adjustments. ([#1754](https://github.com/WordPress/wordpress-playground/pull/1754))
- Docs/Guides: Normalized and fixed guides links. ([#1756](https://github.com/WordPress/wordpress-playground/pull/1756))
- Docs/Guides: Providing content for your demo. ([#1747](https://github.com/WordPress/wordpress-playground/pull/1747))
- Docs/Guides: WordPress Playground for plugin developers. ([#1750](https://github.com/WordPress/wordpress-playground/pull/1750))
- Docs/Guides: WordPress Playground for theme developers. ([#1732](https://github.com/WordPress/wordpress-playground/pull/1732))
- Docs: Links redirections. ([#1758](https://github.com/WordPress/wordpress-playground/pull/1758))

### Contributors

The following contributors merged PRs in this release:

@adamziel @bgrgicak @brandonpayton @juanmaguitar @mho22 @peterwilsoncc


## [v0.9.39] (2024-09-09)

### Bug Fixes
Expand Down
96 changes: 96 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@
"octokit-plugin-create-pull-request": "5.1.1",
"react": "^18.2.25",
"react-dom": "^18.2.25",
"react-hook-form": "7.53.0",
"react-modal": "^3.16.1",
"react-redux": "8.1.3",
"react-transition-group": "4.4.5",
"unzipper": "0.10.11",
"vite-plugin-api": "1.0.4",
"wouter": "3.3.5",
"xterm": "5.3.0",
"xterm-addon-fit": "0.8.0",
"yargs": "17.7.2"
Expand Down Expand Up @@ -104,6 +106,7 @@
"@nx/web": "16.9.0",
"@nx/webpack": "16.9.0",
"@nx/workspace": "16.9.0",
"@playwright/test": "1.47.1",
"@rollup/plugin-url": "^8.0.1",
"@swc-node/register": "~1.6.7",
"@swc/core": "~1.3.85",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ You can go ahead and try it out. The Playground will automatically install the t
| `lazy` | | Defer loading the Playground assets until someone clicks on the "Run" button. Does not accept any values. If `lazy` is added as a URL parameter, loading will be deferred. |
| `login` | `yes` | Log the user in as an admin. Accepts `yes` or `no`. |
| `multisite` | `no` | Enables the WordPress multisite mode. Accepts `yes` or `no`. |
| `storage` | `none` | Selects the storage for Playground: `none` gets erased on page refresh, `browser` is stored in the browser, and `device` is stored in the selected directory on a device. The last two protect the user from accidentally losing their work upon page refresh. |
| `import-site` | | Imports site files and database from a ZIP file specified by a URL. |
| `import-wxr` | | Imports site content from a WXR file specified by a URL. It uses the WordPress Importer plugin, so the default admin user must be logged in. |
| `site-slug` | | Selects which site to load from browser storage. This must be used in combination with `storage=browser`. |
| `site-slug` | | Selects which site to load from browser storage. |
| `language` | `en_US` | Sets the locale for the WordPress instance. This must be used in combination with `networking=yes` otherwise WordPress won't be able to download translations. |

For example, the following code embeds a Playground with a preinstalled Gutenberg plugin and opens the post editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Playground [disables network connections](/blueprints/data-format#features) by d

### Temporary by design

As Playground [streams rather than serves](/about#streamed-not-served) WordPress, all database changes and uploads will be gone when you refresh the page. To avoid losing your work, either [export your work](/quick-start-guide#save-your-site) before or enable storage in the browser/device via the [Query API](/developers/apis/query-api#available-options) or the UI.
As Playground [streams rather than serves](/about#streamed-not-served) WordPress, all database changes and uploads will be gone when you refresh the page. To avoid losing your work, either [export your work](/quick-start-guide#save-your-site) before or enable storage in the browser/device via the "Save" button in the UI.

## When developing with Playground

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading