Skip to content

Q: what should a gts version of flexi-layouts look like? #321

@runspired

Description

@runspired

I think we can simplify things by dong a runtime-only replacement with an option build-plugin to compile away unused variations.

Something like:

import { Layout } from '@html-next/flexi-layouts';

const MyComponent = <template>
  <Layout>
    <:mobile></:mobile>
    <:desktop></:desktop>
  </Layout>
</template>;

export default MyComponent;

Alternatively we might be able to use the template-tag infrastructure to rewrite something like this:

import { Layout } from '@html-next/flexi-layouts';

const MyComponent = <layout>
  <mobile></mobile>
  <desktop></desktop>
</layout>;

export default MyComponent;

Or like this

import { Layout } from '@html-next/flexi-layouts';

class MyComponent extends Component {
  <mobile></mobile>
  <desktop></desktop>
}

export default MyComponent;

Downside of the former is we would no longer be able to do dynamic breakpoints. Names and total breakpoints would have to be preset. Downside of the latter is we might be taking on a lot of tooling support for TS/Glint/LanguageServers etc.

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