-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
What problem does this address?
Currently, we only validate the JSON-imported blueprint at the time of import against the schema. New blank blueprints or blueprints with changes might be invalid. A missing value for the key of a misconfigured step will result in a broken playground.
Proposed solution
Validate blueprint on:
- when blueprint changes
- when the user clicks the action button in the sidebar
- show error msg and highlight step
We can consider the following:
- using schema validation
- use the playground client to run BluePrint
References:
- https://wordpress.github.io/wordpress-playground/developers/apis/javascript-api
- https://wordpress.github.io/wordpress-playground/api/client
Additional context
Using startPlaygroundWeb
from @wp-playground/client
try {
const blueprintJSON = MyBlueprint;
await startPlaygroundWeb({
iframe: IFRAME_ELEMENT,
remoteUrl: 'remote.html',
blueprint: blueprintJSON,
});
} catch (error) {
// TODO: do something with captured error
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request