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

App shell #19

Merged
merged 31 commits into from
Sep 2, 2024
Merged

App shell #19

merged 31 commits into from
Sep 2, 2024

Conversation

psrpinto
Copy link
Member

@psrpinto psrpinto commented Aug 28, 2024

This PR sets up the "scaffolding" for the reimagined extension, as discussed between myself and @akirk. The extension is now structured so that there's an App (where our code lives), with Playground running next to it. This PR only sets up the basic foundations, it does not do anything useful yet.

Some considerations:

  • I went with React as it felt appropriate since:
    • We're building a single page app that exists entirely in the frontend
    • React is already extensively used in the WordPress ecosystem (e.g. Block Editor)
  • The navigation is driven by react-router, which in essence maps URLs to components
    • react-router is widely used in React projects
  • The app remembers what screen is open, so when it reloads it goes to the correct screen.

Screen captures

Note that Playground only re-renders when the session changes, which is what we want. That's not visible in this recording because there are currently no other pages to transition to, but I've tested this with a dummy page and can confirm Playground does not re-render when transitioning between pages in the same session.

Screen.Recording.2024-08-30.at.19.21.20.mov

The data in local storage looks like this:

Screenshot 2024-08-30 at 20 09 44

@psrpinto psrpinto force-pushed the app-shell branch 2 times, most recently from d702a30 to 90eea26 Compare August 30, 2024 17:50
@psrpinto psrpinto self-assigned this Aug 30, 2024
@psrpinto psrpinto marked this pull request as ready for review August 30, 2024 19:04
@psrpinto psrpinto requested a review from akirk August 30, 2024 19:05
@akirk
Copy link
Member

akirk commented Sep 2, 2024

Looks very promising already! Some observations: we reload the playground iframe as a whole, I think'd be better if we keep the iframe around in the wp-admin tab and the preview iframe is one that links to the right localhost/scope:0.1234 URL for the playground. That should make it easier to avoid reloading of playground. (I know you mentioned this in your description but in my local testing I saw playground load several times._ Also we should already load playground in the background as the app starts so that in the optimum case the user never sees the playground loading screen.

Also we should show the preview section below the app section if the sidebar is not wide enough.

@psrpinto
Copy link
Member Author

psrpinto commented Sep 2, 2024

we should show the preview section below the app section if the sidebar is not wide enough.

Opened #21 to track this.

we should already load playground in the background as the app starts so that in the optimum case the user never sees the playground loading screen.

Opened #22.

keep the iframe around in the wp-admin tab and the preview iframe is one that links to the right localhost/scope:0.1234 URL for the playground.

Agree, I will do so in the next PR.

@psrpinto psrpinto merged commit f4e1c96 into trunk Sep 2, 2024
1 check passed
@psrpinto psrpinto deleted the app-shell branch September 2, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants