Skip to content

[Features] Features should be configurable outside of the createApp helper #691

@titouanmathis

Description

@titouanmathis

Features like breakpoints can be configured today when calling createApp():

import { createApp, Base } from '@studiometa/js-toolkit';

class App extends Base {
  static config = {
    name: 'App',
  }
}

createApp(App, {
  breakpoints: {
    s: '40rem',
    m: '80rem',
    l: '100rem',
  },
});

With the introduction of the registry in v3.4.0 and of the registerComponent() helper, the createApp() function is no longer the only way to mount components.

We should either have:

  • one helper function for each feature: defineBreakpoints(), defineAttributes(), etc.
  • a single defineFeatures() helper function
  • or a Feature component whose options could be mapped to the features map

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions