Skip to content

[TS/JS] making the emitted JS match the emitted TS ? #4951

Description

@goswinr

I emit TS to then use tsc to make d.ts files for my code. But this creates functions for DUs that don't exist in the emitted JS.

type Foo = 
    |Bar
    |Baz

Compiled to TS emits

 ...

export function Foo_Bar() {
    return new Foo<0>(0, []);
}

export function Foo_Baz() {
    return new Foo<1>(1, []);
}
...

But those don't get emitted when compiling to JS.

Image

I suggest making the emitted JS match the emitted TS.

For now, I can't use TS only because of some other errors in the emitted TS (yes, I could dig into those, but the emitted js works fine)
I would like to have d.ts for the public surface of my JS. When just creating d.ts files tsc can jump over the other errors.

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