Skip to content

Hooking up into the generator pipeline #12277

Closed

Description

Hello,

Let me describe my problem statement:
Currently if you have a valid .tsx file with JSX notations, JavaScript is generated, which is fine.
Now if you want to make changes how the generated JavaScript is generated it is really difficult, difficult because I couldn't find documentation about this process and it seems currently that the generator pipeline is not build for such use-cases (I'm not sure if this is really the case or not)?!?

So let me explain what I want to do:
The goal is to produce beside what the JSX transformer is producing some additional ts or d.ts files so that you have strong typed views. It could be compared with WPF XAML.

Example:

body.tsx

export let Body = () => 
    <div id="div1" class="div1_css">
        Div1
        <div>
            Div2
            <div name="div3">Div3</div>
            <span name="span1">Span1</span>
        </div>
        <button name="button1">Button1</button>
        <button name="button2">Button2</button>
    </div>

And now what I would like to produce based on the the body.tsx

body.ts

export interface Body
{
    div1 : div1;
}

export interface div1 extends HTMLDivElement
{
    div3 : div3;
    span1 : span1;
    button1: button1;
    button2: button2;
}

export interface div3 extends HTMLDivElement {}

export interface span1 extends HTMLSpanElement
{
    content : string;
}

export interface button1 extends HTMLButtonElement {}

export interface button2 extends HTMLButtonElement {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions