Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Discussion and Vote: Pattern State Declaration, and other Pattern Metadata #16

Closed
@bmuenzenmeyer

Description

@bmuenzenmeyer

As a Pattern Lab Node user, I use a configuration json file to define pattern states. Am I compliant with the spec?


Pattern States in PL/Node use a key/value object defined in patternlab-config.json instead of the PHP filename approach, which uses filename suffixes.

Here's an example from the docs:

"patternStates": {
  "molecules-single-comment" : "complete",
  "organisms-sticky-comment" : "inreview",
  "templates-article" : "complete"
}

This was a conscious decision made at time of implementation, with the following benefits:

  • reduce fatigue with yet more regexes
  • I also thought it'd be simpler to change states in one place rather than have to rename files- an action, that, in my opinion, always feels costly from a UX perspective (just clicking through and editing) and results in a mess for version control systems.

This deviation would, however, make someone porting from PL/* to the other a bit more cumbersome. Though, pattern states might be low on their priority list when switching anyways.

What I am asking with this question is whether or not this deviation from PHP is in spec.

The timeline for this feature is dependent on the outcome of this issue, as spec compliance is a goal of PL/Node.

Tagging spec-question because I need input regarding compliance, and am not proposing a change to PHP's strategy.

This issue does not require a vote in my opinion, but we should perhaps open a process question to determine how questions like this are handled officially in the future. I'll wait to create one until after this issue shakes out.


JUNE 3RD EDIT

  • parse status out of a pattern's .md Front Matter and map to a pattern's patternState proprerty
  • parse order out of a pattern's .md Front Matter and use to override any file order prior to rendering
  • parse hidden out of a pattern's .md Front Matter and use to hide pattern from all direct individual or subtype rendering similar to _underscoredPattern.mustache today. These patterns should still be include-able as partials
  • parse excludeFromStyleguide (or a better name) out of a pattern's .md Front Matter and use to omit pattern from all rendering
  • parse tags out of a pattern's .md Front Matter and ... ??? (available in a future search enhancement?)
  • parse additional keys ouf of a pattern's .md Front Matter and display in {{patternDescAdditions}}

/cc @pattern-lab/voting-members

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions