Skip to content

blueprint: validation #91

@ajitbohra

Description

@ajitbohra

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:

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions