GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add AST definition for the Source Phase Imports proposal by nicolo-ribaudo · Pull Request #306 · estree/estree

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented May 17, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The Import Reflection proposal (https://github.com/tc39/proposal-import-reflection/) has been updated to use the following syntax:

  • import source X from "X"
  • import.source("X")

It is now part of a bigger set of features, that allow importing different "phases" of a module:

  • import source X from "X"
  • import instance X from "X" (which is currently not tracked in any proposal, but it is being considered as part of the intersection between import reflection and https://github.com/tc39/proposal-compartments/blob/master/0-module-and-module-source.md)
  • import defer * as ns from "X" - https://github.com/tc39/proposal-defer-import-eval/

You can read this presentation for more details.

All these "phases" are not composable, so I chose to represent them in the AST as an enum instead of boolean properties. However, this PR only adds support for source since it's the only one introduced by this proposal.

I am on the fence regarding what to do with import x from "X". Should phase be null since it is the default phase, or should we always set phase to a string and thus something like "full"/"evaluation"?

(PS. The ESTree AST works much better than the Babel AST when trying to define import.source() 😄)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nicolo-ribaudo
Add AST definition for the Source Phase Imports proposal
d7e774f
@JLHwung

JLHwung commented May 17, 2023

Copy link
Copy Markdown
Contributor

Can you add a deprecation note on https://github.com/estree/estree/blob/master/experimental/import-reflection.md? We have done something similar in https://github.com/estree/estree/blob/master/stage3/import-assertions.md. Or we can just remove import-reflection since that syntax is no longer proposed.

nicolo-ribaudo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JLHwung
JLHwung reviewed May 17, 2023
View reviewed changes
Comment thread experimental/import-source-phase.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JLHwung

JLHwung commented May 17, 2023

Copy link
Copy Markdown
Contributor

The proposal's url slash import-reflection is not renamed to import-source-phase, in this case maybe we can just replace the current import-reflection docs with the new one.

nzakas reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nzakas

nzakas commented Jun 1, 2023

Copy link
Copy Markdown
Contributor

@nicolo-ribaudo are you planning on updating this PR based on that last comment?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo

nicolo-ribaudo commented Jun 1, 2023

Copy link
Copy Markdown
Contributor Author

@guybedford @lcasdev Any plans to rename the proposal repo given the name change?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo
Proposal rename
09d6f58
@nicolo-ribaudo

nicolo-ribaudo commented Jun 6, 2023

Copy link
Copy Markdown
Contributor Author

PR updated to match the new proposal URL: https://github.com/tc39/proposal-source-phase-imports

JLHwung reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JLHwung
JLHwung approved these changes Jun 6, 2023
View reviewed changes
@JLHwung JLHwung mentioned this pull request Jun 7, 2023
RFC 0004: Add ImportExpression AST type babel/rfcs#4
Merged
nzakas
nzakas approved these changes Jun 8, 2023
View reviewed changes

@nzakas nzakas left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nzakas
nzakas merged commit 18507cc into estree:master Jun 8, 2023
@nicolo-ribaudo
nicolo-ribaudo deleted the patch-1 branch June 8, 2023 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nzakas nzakas nzakas approved these changes
@JLHwung JLHwung JLHwung approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@nicolo-ribaudo @JLHwung @nzakas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.