Sitelet https://github.com/dataformsjs/dataformsjs/issues/16#top
Skip to content

Add an API to JSX Loader #16

Description

@elevatebart

Hello!

What an incredible product you have here.
I know forms are a pain to produce, and this will help.

What caught my eye more than anything is the jsxLoader.

I really like it and would love to use it to make react-styleguidist faster.

  • Do you think it could be made into a separate npm package?
  • Do you think one could ask for a specific pragma to package the jsx?
    • for mercurial it's mercurial.h, for vue simply h
  • Most importantly, do you think that this transformation could be done without running the code?

I was thinking of an api like this

import { transform } from '@dataformjs/jsx-loader'

const desugarizedCode = transform('<Comp>hello mama</Comp>', {pragma: 'h'})
console.log(desugarizedCode)
// "h(Comp, , ['hello mama'])"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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