Skip to content

[BUG] Examples don't work in playground #102

@OldStarchy

Description

@OldStarchy

Describe the bug
The $$ts! example that autoloads (randomly) on https://googlefeud.github.io/ts-macros/ does not work, the output is empty

Code to reproduce

// Interactive playground!
// Write your code here and see the transpiled result.
// All types and functions from the library are already imported!

type ClassInfo = { name: string, value: string };

function $makeClasses(...info: Array<ClassInfo>) {
    +[[info], (classInfo: ClassInfo) => {
        $$ts!(`
            class ${classInfo.name} {
                constructor() {
                    this.value = ${classInfo.value}
                }
            }
        `);
    }];
}

$makeClasses!({name: "A", value: "123"}, {name: "B", value: "345"});

Expected behavior
The example should work

Additional context
Many of the examples in index.ts also do not work in the playground.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions