Dev preview: Fractal component parser v2

As described in our previous post, we’ve been busy working on the underlying parsing engine and plugin system for what will become the next major version of Fractal.

It’s still very much a work in progress, but we’ve just released an initial developer preview of the filesystem parsing engine (and plugin/extension system) for people to have a play with. You can check out the release itself on the v2 branch of the main Fractal repository and some examples of it in use in the v2 demo repo.

Some important things to note about what this is (and what this isn’t):

  • This is just the filesystem parser. No web UI generation, no CLI — it is just a Node package for parsing a filesystem of components and retrieving information about that component set. As such, it’s a low-level tool and not one that many people will need to use directly once all the other parts are in place. But this parser will necessarily form the core of all tools built on top of it, so it’s an important part of the jigsaw.
  • The developer preview is intended to give some insight into the way that the filesystem parsing in v2 will be handled, as well as to provide a preview of the way that plugins, template engine adapters and extensions will work. At this point it is not intended to provide feature parity with the current set of Fractal features (such as context data, variants, tags and suchlike). These will all be authored as plugins — some of which may still get bundled with the core parser — but at the moment they have not been (re-)implemented.
  • The filesystem structure ‘rules’ for components have been simplified greatly to (hopefully) remove ambiguity and reduce complexity. The new filesystem parser is not compatible with v1-format projects, so check out the demo repo example components directory or the naming convention documentation for details before diving in. The intention is to provide a CLI task or ‘shim’ plugin to help support migration from v1-format repos to this new structure, but this will be one of the last pieces that we address in the v2 development work.
  • The current set of available template engine adapters are really just at a proof-of-concept stage and only provide very basic view rendering capabilities. There is a lot of complexity around making rendering templates work well for both documentation and production use-cases, so we’ve intentionally held off adding too much functionality into this area yet.
  • We’d love people to have a play and to give us feedback, but please don’t build anything mission-critical using it yet :-) It’s very ‘alpha’ at the moment and the APIs may still change as we build out the other parts of the system on top of it.

So what’s next?

There is still a lot of work to do to port over existing features of the parsing process to the new plugin-based system. Initially we are just looking at the ones that are needed to support Fractal’s core feature set, and hopefully adding some nice improvements in there along the way.

Alongside this, we are looking at the new static site builder that will replace the existing ‘web UI’ build system. This will likely be the next piece that we release as a developer preview so that everyone can see the direction that we are taking with it and how we will hopefully be making it a much more customisable way to build documentation sites for your component libraries.

As ever, any feedback is much appreciated so leave us a comment or jump into the Fractal Slack group to continue the discussion there.