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

Add a principle discouraging folks from defining novel microsyntaxes #213

Open
hober opened this issue Jun 8, 2020 · 5 comments
Open

Add a principle discouraging folks from defining novel microsyntaxes #213

hober opened this issue Jun 8, 2020 · 5 comments
Assignees
Labels
Priority: High Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) Topic: Meta

Comments

@hober
Copy link
Contributor

hober commented Jun 8, 2020

This came up when discussing options for Declarative Shadow DOM to specify options for attachShadow() in a declarative context.

@dbaron
Copy link
Member

dbaron commented Jun 8, 2020

It's possible this principle is more widely accepted for HTML than it is for CSS.

It might be worth figuring out what the criteria are for when to add a new microsyntax.

@marcoscaceres
Copy link
Contributor

An emphasis on encouraging a lot of community communication is important... some rough questions people could ask themselves before embarking on creating a new micro-syntax...

  • does a micro-syntax already exists do meet your needs? Did you check HTML or the rest of the platform? Did you ask the TAG or HTML WG?

Should you choose to adopt a micro-syntax in a new context:

  • What limitation did the original micro-syntax overcome? (i.e., why was it created in the first place?)
  • Do the assumption made, or limitation overcome, by the original micro-syntax still exist since it was created?
  • If the micro-syntax is being adapted to a different format (e.g., JSON), are you sure that using a native type wouldn't be better? (e.g., using a "space separated list" when you could just use an array).

Creating a new micro-syntax:

  • Are you following conventions already used in the wild (e.g. ES template literals)?

@kenchris
Copy link
Contributor

Examples: viewport meta tag special micro syntax can caused a lot of issues over the years as it was being parsed differently by different UAs

@LeaVerou
Copy link
Member

Another example that came up recently was the supports keyword in the src descriptor in @font-face: w3ctag/design-reviews#666

@LeaVerou LeaVerou added Topic: Meta Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) labels Sep 16, 2021
@LeaVerou LeaVerou self-assigned this Sep 16, 2021
@LeaVerou
Copy link
Member

We discussed this with @kenchris in a breakout today and we think there is enough good content in this issue that could be easily turned into a principle. I will try to take a stab at writing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) Topic: Meta
Projects
None yet
Development

No branches or pull requests

5 participants