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

Migrate pattern library to Fractal #264

Closed
james-nash opened this issue May 19, 2019 · 1 comment
Closed

Migrate pattern library to Fractal #264

james-nash opened this issue May 19, 2019 · 1 comment
Assignees
Labels
infrastructure CATEGORY: Infrastructure related - e.g. updates to build process, tests, tooling, etc. 🌟 enhancement TYPE: Indicates new feature requests WIP STATUS: Work in Progress - Do Not Merge. Useful for long-running PRs
Milestone

Comments

@james-nash
Copy link

james-nash commented May 19, 2019

Is your feature request related to a problem? Please describe.
So far we have been using Pattern Lab to generate our pattern library website. While it has served us well, we are facing some issues and limitations:

  • The UI of the current 3.x alphas/betas is buggy ("view all" links don't always work, preview iframe doesn't resize its height when you navigate to other patterns, etc.). While the PL community is very active, it's not clear how soon these issues will be fixed. Also, we don't want to downgrade back to 2.x as that's not getting updates any more
  • The latest version of the Nunjucks pattern engine no longer seems to produce lineage links for {% import ... %} and {% extend ... %}. Since we use those widely, a lot of our lineage links have therefore disappeared :-(

Fortunately, an alternative exists: Fractal. It offers pretty much all the same features PL has, but doesn't suffer from the 2 issues described above. While Fractal's continued development was uncertain a few months ago, a community has since rallied behind it and work on it is active once more.

Furthermore, Fractal has some features that PL does not which are useful to us:

  • Ability to use different preview layouts per component. E.g.: We could use this to have a preview that overrides the usual flex on body stuff for individual components, and another which does not for templates and pages
  • Grouping component files into folders. It's nice to have the data, docs and template altogether as a unit. This also makes it easier if we want to reorder or reorganise components, since we only need to change the directory name
  • We can use Fractals API to make a customised component template export function (they have an example and I have done something very similar in a personal project, so can confirm it works). This will help pave the way to publishing the Nunjucks templates as an NPM package for other projects to consume
  • Ability to use JS files to provide context data. We could use this to auto-generate dummy content or fetch realistic content from some APIs. Saves writing everything out as JSON manually!

Based on some discussions and experiments, the Gravity maintainers have therefore decided to migrate to Fractal.

Describe the solution you'd like

  • Remove Pattern Lab dependencies
  • Add Fractal dependencies
  • Rename and update templates and data files to work with Fractal

Related to #106

@james-nash james-nash added 🌟 enhancement TYPE: Indicates new feature requests WIP STATUS: Work in Progress - Do Not Merge. Useful for long-running PRs infrastructure CATEGORY: Infrastructure related - e.g. updates to build process, tests, tooling, etc. labels May 19, 2019
@james-nash james-nash added this to the Gravity NEXT milestone May 19, 2019
@james-nash james-nash self-assigned this May 19, 2019
@james-nash
Copy link
Author

Closing this as it's been done by PR #262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure CATEGORY: Infrastructure related - e.g. updates to build process, tests, tooling, etc. 🌟 enhancement TYPE: Indicates new feature requests WIP STATUS: Work in Progress - Do Not Merge. Useful for long-running PRs
Projects
None yet
Development

No branches or pull requests

1 participant