Skip to content

Proposal: consider an alternative name from defer #17

@guybedford

Description

@guybedford

It could help understandability of the semantics of this proposal to more clearly disambiguate import defer from export defer given that they are semantically very different proposals.

I think if anything, considering these as optional reexports would most closely capture the semantics that are specified in an intuitive way to understand what is going on.

To list some of the confusions that could be resolved with renaming:

  • export defer sounds like the export will execute sometime later on, when in fact it only might execute.
  • import * as foo contains optional entries that only execute when used, and as such will defer deferred reexports. On the other hand, I might have imagined only import defer * as foo would be needed to get the deferred values for an export defer. Considering them as optional more clearly explains why there is no relation here.
  • export defer * from 'foo' sounds like it might work based on syntactical symmetry, when in fact it is unsupported and likely never will be supported by this proposal. An export optional * from 'foo' is less likely to be assumed to work by symmetry of syntax here, once one understands that optionals are always named upfront.

In addition, this could more clearly align the proposal with the suggestion in #16.

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