Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooking up into the generator pipeline #12277

Closed
biqas opened this issue Nov 15, 2016 · 1 comment
Closed

Hooking up into the generator pipeline #12277

biqas opened this issue Nov 15, 2016 · 1 comment
Labels
Question An issue which isn't directly actionable in code

Comments

@biqas
Copy link

biqas commented Nov 15, 2016

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 {}
@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2017

You can look at the compiler API as well as the transform API.

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Apr 27, 2017
@mhegazy mhegazy closed this as completed Apr 27, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

2 participants