Stop repeating yourself repeating yourself reaepting yuroslef rpaetnig ouylefs
Today we’re launching an exciting new way to build and collaborate in Hex: Components.
Components are groups of cells your team can write once and re-use across projects. They make data work more consistent, efficient, and less error-prone. They also make it easier for users of all technicality levels to take advantage of logic written by experts. It's a huge upgrade to how teams work together and collaborate in Hex!
Check out a quick demo here, or read more below:
If you’re anything like us, you’ve probably thought “haven’t I seen this before?”… or worse, “haven’t I done this before??” as you have worked on a data project. Teams everywhere rewrite the same queries and code over and over, leading to rework, variation, and error.
There are some existing - but limited - ways to get around this. Factoring code out into shared Git repos (already supported in Hex!) is great for stuff like shared utility functions, but not for SQL. Metrics stores like dbt Semantic Layer, MetricFlow, and Cube (already supported in Hex!) are helpful for query-like calculations, but are not useful for Python code or other elements, like visualizations or no-code cells. Shared docs with code that you copy-and-paste out is… well, that’s not really a solution, but I know many of us have resorted to this.
All-in-all, this re-work is a staple of many data workflows, and a pain point that we heard about all the time from our customers.
So, we built Components: a new feature that empowers teams to operate with better collaboration and consistency.
Components are reusable groups of cells, and bring the DRY model from software development to analytics. Editors can easily publish new components, and import existing ones into projects. Changes to a component can be made once, and then propagate down into projects that rely on it.
Over time, your team can build up a centralized repository of consistent, usable logic, and empower others to do great things with data.
You can easily promote any group of cells in a project to be a component. Simply use the (new!) multi-select feature to select a chunk of logic, and select “Create Component” at the bottom. You’ll be able to set some metadata, publish your new component, and replace the existing cells with the new component.
Like Projects, Components can also be created from the new Components view, either from scratch or through copy-pasting groups of cells in.
It’s fast and easy to browse for available components and add them to a project:
Hex’s reactive compute engine automatically picks out the defined variables in the component, and makes them available for reference in downstream cells.
If a change is made to the component source, Hex will indicate that an update is available, and you can quickly view the diff and pull a new version:
Need to make project-specific changes to your component? No problem - you can opt to import a component as detached cells, or later “eject” cells from an already-imported component:
Components are now available on all paid plans of Hex. Users on Pro can share up to 3 components with their workspace, with Teams and Enterprise allowing for unlimited shared components.
And, if you’re not using Hex yet, you can start a free-forever account here.