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

Re-add imported and fix value for named imports #39

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

Ayc0
Copy link
Contributor

@Ayc0 Ayc0 commented Jan 4, 2023

In the readme, we mention that we expose:

export const importStatements = [
    {
        module: "@blocz/elements",
        imports: [
            {
                kind: "named",
                imported: "Button",
                local: "Button",
                value: this_is_the_value_of_the_variable_Button
            },
            {
                kind: "named",
                imported: "Tabs",
                local: "Tabulations",
                value: this_is_the_value_of_the_variable_Tabs
            }
        ]
    }
];

But we forgot to include the imported value.

Also the value was bound to the imported field, and when an import is renamed, like import { foo as bar }, then the variable foo is not defined anymore in the MDX, resulting in a crash when loading the MDX: Uncaught ReferenceError: foo is not defined.

@Ayc0 Ayc0 force-pushed the Ayc0/fix-imported-and-value branch from a9de96e to 079ad7c Compare January 4, 2023 22:06
@Ayc0 Ayc0 enabled auto-merge January 4, 2023 22:06
@Ayc0 Ayc0 merged commit 8724447 into main Jan 4, 2023
@Ayc0 Ayc0 deleted the Ayc0/fix-imported-and-value branch January 4, 2023 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant