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

Update Blueprint schema to remove alerts when using the shorthand syntax #1282

Open
ironnysh opened this issue Apr 19, 2024 · 6 comments
Open

Comments

@ironnysh
Copy link
Collaborator

When using VS Code to compose a Blueprint that contains the shorthand syntax of the siteOptions step and plugins step, the editor alerts that these are deprecated:

image

Now that shorthands are here to stay and featured in the official docs, it's probably safe to remove the warnings from the schema (see these lines).

BTW, the Builder doesn't identify the shorthand syntax as an error. Is it using another version of the schema for validation?

@bph
Copy link
Contributor

bph commented May 29, 2024

Hmm, the deprecation message reads: 'This experimental option will change without warning.\nUse steps instead."

That's making it a bit clearer, that it's experimental and not obsolete.
Are shorthand blueprint properties to stay?
Is there a way for VS Code to display that message?

The JSON schema specs notice the deprecated property needs to be boolean.

"The value of this keyword MUST be a boolean. When multiple occurrences of this keyword are applicable to a single sub-instance, applications SHOULD consider the instance location to be deprecated if any occurrence specifies a true value.

If "deprecated" has a value of boolean true, it indicates that applications SHOULD refrain from usage of the declared property. It MAY mean the property is going to be removed in the future."

@bph
Copy link
Contributor

bph commented May 29, 2024

@adamziel let me know if the implementation is cemented enough for the "deprecated" property to be removed, and I create a PR for it.

@ironnysh
Copy link
Collaborator Author

ironnysh commented May 29, 2024

Here's the original discussion (for reference/background):

... are the shorthands documented somewhere?

They aren't at the moment, I've added them as an experimental feature a few months ago and didn't want to spread them too much in case I'd have to remove them later on. Today I'm quite certain they're here to stay which also means there are no more blockers to documenting them.

@bph
Copy link
Contributor

bph commented May 29, 2024

The documentation is available: https://wordpress.github.io/wordpress-playground/blueprints-api/steps-shorthands

@ironnysh
Copy link
Collaborator Author

Yup, I did it based on @adamziel's explanation 😊

@bph
Copy link
Contributor

bph commented May 30, 2024

Thank you @ironnysh. Wonderful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants