# export-default-from: what's the status?

**URL:** <https://es.discourse.group/t/export-default-from-whats-the-status/1693>\
**Category:** 🦋 Proposals\
**Created:** [April 12, 2023, 5:29am UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693 "2023-04-12T05:29:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh-Cena](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/josh-cena/32/1408_2.png) [@Josh-Cena](https://es.discourse.group/u/Josh-Cena)\
**Post date:** [April 12, 2023, 5:29am UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693/1 "2023-04-12T05:29:06Z")

</div>

#### Proposal: [GitHub - tc39/proposal-export-default-from: Proposal to add `export v from "mod";` to ECMAScript.](https://github.com/tc39/proposal-export-default-from)

This proposal has stagnated for a while. It seems the proposal is still [waiting for spec text](https://github.com/tc39/proposal-export-default-from/issues/6#issuecomment-584449124), but I see that spec text is already written and not in a bad shape (I did not look too closely). I wonder what community effort would help bring it forward.

On a related note, I hope `export default from "mod";` can be dropped from the proposal because it introduces so many ambiguities while the counterpart `import default from "mod";` isn't even valid syntax. I didn't create an issue for this because the repo seems dead.

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [April 12, 2023, 6:18am UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693/2 "2023-04-12T06:18:22Z")

</div>

`import whatever from 'mod'` is absolutely valid syntax.

---

<div class="post-metadata">

**Author:** ![Josh-Cena](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/josh-cena/32/1408_2.png) [@Josh-Cena](https://es.discourse.group/u/Josh-Cena)\
**Post date:** [April 12, 2023, 6:30am UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693/3 "2023-04-12T06:30:26Z")

</div>

Right, but I'm talking about `import default from "mod"` literally. The proposal wants to allow `export default from "mod"` but that creates [quite some trouble](https://github.com/tc39/proposal-export-default-from/issues/2).

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [April 12, 2023, 6:46am UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693/4 "2023-04-12T06:46:26Z")

</div>

That's just a bug in the spec text; there's no issue with it.

`import default from 'mod'` is certainly invalid, but making `export default from 'mod'` is one of the whole points of that proposal.

---

<div class="post-metadata">

**Author:** ![Josh-Cena](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/josh-cena/32/1408_2.png) [@Josh-Cena](https://es.discourse.group/u/Josh-Cena)\
**Post date:** [April 12, 2023, 2:15pm UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693/5 "2023-04-12T14:15:53Z")

</div>

How can such bugs be fixed, though? By that I mean keeping the parse result of these:

```js
export default from;

```

```js
export default from
ARandomExpression;

```

The only conceivable fix to me looks like this:

```javascript
export default [lookahead ≠ from] AssignmentExpression;
export default [lookahead = from;] AssignmentExpression;
export ModuleExportName from [NLTH] ModuleSpecifier;

```

...but that just looks so, so ugly. Alternatively we can use a cover grammar, but again it doesn't seem to justify the effort.

At the end of the day I don't know why this form has to be proposed. We already have `export { default } from "mod";`. The proposal says we need `export v from "mod";` because people expect it to work based on symmetry with imports, and that's convincing. But I don't know why anyone would expect `export default from "mod";` to work when there's no import counterpart.

Anyway, my question would more be "what is the criteria for stage 2 because spec text is complete (although buggy)" and "how may community effort help bring it forward or is it awaiting design choices from the champions for the bug above".

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [April 12, 2023, 2:56pm UTC](https://es.discourse.group/t/export-default-from-whats-the-status/1693/6 "2023-04-12T14:56:43Z")

</div>

It requires a champion, at the least - i don’t think community effort can do anything at this point.
