Skip to content

Adding blueprint.json for enabling plugin previews in WP.org plugin repo#242

Open
ashfame wants to merge 6 commits into
mainfrom
blueprint
Open

Adding blueprint.json for enabling plugin previews in WP.org plugin repo#242
ashfame wants to merge 6 commits into
mainfrom
blueprint

Conversation

@ashfame

@ashfame ashfame commented Jan 17, 2024

Copy link
Copy Markdown
Member

This PR moves the assets directory one level under .wporg so that blueprint generating script and setup php code can reside there.

The idea of the helper files (blueprint_runphp_step_code.php and update_blueprint.sh) is to easily manage the setup PHP code in an actual PHP file and using the bash script to update the runPHP step's code in blueprint.json.

Playground preview based on the blueprint file in this PR - https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/automattic/chatrix/blueprint/.wporg/assets/blueprints/blueprint.json

@ashfame
ashfame requested review from akirk and psrpinto January 17, 2024 18:44
@ashfame ashfame self-assigned this Jan 17, 2024

@akirk akirk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and looks good, great job!

@psrpinto psrpinto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@psrpinto

psrpinto commented Jan 18, 2024

Copy link
Copy Markdown
Member

I figured it would not be too hard to make it possible to disable the service worker, so I done that in #243.

If we get that one merged first, you should then be able to do the following to disable the service worker:

<!-- wp:automattic/chatrix {"enableServiceWorker":false,"instanceId":"4986644425212020","defaultHomeserver":"matrix.org"} /-->

@ashfame

ashfame commented Jan 19, 2024

Copy link
Copy Markdown
Member Author

@psrpinto Awesome, lets get merged first and then I can make changes in this PR and hopefully the login would work now 🤞

@ashfame

ashfame commented Jan 19, 2024

Copy link
Copy Markdown
Member Author

Good news, the login worked with service worker disabled. 👌

Bad news, it still sometimes try to load the service worker and fails with "something went wrong .... sw.js load failed". Almost always does on popup page.

Here is the playground link with main branch of chatrix - https://playground.wordpress.net/?blueprint-url=https://blog.ashfame.com/a8c/blueprint.json

Another blocker would be that on page refresh, it retains the matrix logged in session. I believe, it shouldn't be the case before this goes live for users.

@psrpinto

Copy link
Copy Markdown
Member

The enableServiceWorker attribute only applies to the block, so indeed popup will still use the service worker.

Concerning, the session remaining logged-in after refresh, I would assume thats the expected behaviour, as that's also how the plugin works in "normal" conditions. Would it not be weird that the plugin works differently in the playground?

@ashfame

ashfame commented Feb 1, 2024

Copy link
Copy Markdown
Member Author

Concerning, the session remaining logged-in after refresh, I would assume thats the expected behaviour, as that's also how the plugin works in "normal" conditions. Would it not be weird that the plugin works differently in the playground?

I worry to stand out from the playground's perspective of "All your changes are private and gone after a page refresh." :)

And even if we are tying up with playground's db setting, we would still not be able to reliably wipe chatrix storage when playground wipes its storage.

So currently, this is on hold as I don't feel comfortable pushing this live as is. I would rather Chatrix lose everything upon reload rather than risk leaving an access token behind for a user when they just leave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants