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

module-lexer no longer in the oxc-parser npm package #7788

Closed
walkerdb opened this issue Dec 11, 2024 · 2 comments
Closed

module-lexer no longer in the oxc-parser npm package #7788

walkerdb opened this issue Dec 11, 2024 · 2 comments
Labels
C-bug Category - Bug

Comments

@walkerdb
Copy link

In oxc-parser@0.38.0 I can reference oxc.moduleLexerSync and oxc.moduleLexerAsync.

As of oxc-parser@0.39.0 that function is no longer exported.

Was that intentional? I can't find any mention of relevant breaking changes in changelogs. Was it extracted to its own package instead?

@walkerdb walkerdb added the C-bug Category - Bug label Dec 11, 2024
@Boshen
Copy link
Member

Boshen commented Dec 11, 2024

It is removed, but returned directly from the parser instead. See https://github.com/oxc-project/oxc/blob/main/napi/parser/test/__snapshots__/esm.test.ts.snap for examples.

Two reasons it was removed:

  • has an extra ast pass
  • does not return all esm information

Please let me know if there are values missing.

@Boshen Boshen closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
@ryanatkn
Copy link

ryanatkn commented Jan 8, 2025

Were dynamic imports with string literal specifiers omitted intentionally? I expected to see dynamicImports on EcmaScriptModule alongside staticImports to get the previously supported data. A workaround is just crawling the AST yourself:

import('dynamic_import')

{
  "type": "ImportExpression",
  "start": 0,
  "end": 24,
  "source": {
    "type": "Literal",
    "start": 7,
    "end": 23,
    "value": "dynamic_import",
    "raw": "'dynamic_import'"
  },
  "arguments": [],
  "phase": null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

3 participants