mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.76k stars 1.14k forks source link

Add support for non-identifiers in export/imports #2536

Open wooorm opened 2 months ago

wooorm commented 2 months ago

Initial checklist

Affected packages and versions

all, probably

Link to runnable example

No response

Steps to reproduce

import { 'alpha-bravo' as charlieDelta } from 'echo'
export { 'foxtrot-golf' as 'hotel-india' } from 'juliet'

Expected behavior

should work, somehow, probably.

Actual behavior

https://github.com/davidbonnet/astring/issues/713

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

wooorm commented 2 months ago

I confirmed on the playground that this now compiles to the broken code:

import {undefined as charlieDelta} from 'echo';
export {undefined} from 'juliet';

…due to the astring bug

wooorm commented 1 month ago

This was also just added to the @types/estree: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/70504.