Skip to content

fix(codegen): add missing dot when printing import.defer and import.source#13975

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-import-phase-codegen
Sep 21, 2025
Merged

fix(codegen): add missing dot when printing import.defer and import.source#13975
graphite-app[bot] merged 1 commit intomainfrom
fix-import-phase-codegen

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Sep 21, 2025

Summary

Fixes the codegen to correctly print import.defer() and import.source() expressions. Previously, the dot was missing, resulting in invalid syntax like importdefer() and importsource().

Changes

  • Added missing dot (.) between import and the phase (defer or source) in the ImportExpression code generation
  • Added test cases to verify both import.defer() and import.source() are correctly generated

Closes #13971

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings September 21, 2025 13:30
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 21, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes a bug in JavaScript codegen where import.defer() and import.source() expressions were incorrectly generated without the required dot, producing invalid syntax like importdefer(). The fix adds the missing dot character and includes comprehensive test coverage.

  • Added missing dot character between import and phase keywords in ImportExpression codegen
  • Added test cases covering both minified and non-minified output for import.defer() and import.source()

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/oxc_codegen/src/gen.rs Adds missing dot character in ImportExpression code generation
crates/oxc_codegen/tests/integration/js.rs Adds test coverage for import phase expressions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added A-codegen Area - Code Generation C-bug Category - Bug labels Sep 21, 2025
@Boshen Boshen self-assigned this Sep 21, 2025
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Sep 21, 2025
Copy link
Member Author

Boshen commented Sep 21, 2025

Merge activity

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 21, 2025

CodSpeed Instrumentation Performance Report

Merging #13975 will not alter performance

Comparing fix-import-phase-codegen (8f3f460) with main (0185984)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (8f3f460) during the generation of this report, so 0185984 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

…ource (#13975)

## Summary
Fixes the codegen to correctly print `import.defer()` and `import.source()` expressions. Previously, the dot was missing, resulting in invalid syntax like `importdefer()` and `importsource()`.

## Changes
- Added missing dot (`.`) between `import` and the phase (`defer` or `source`) in the ImportExpression code generation
- Added test cases to verify both `import.defer()` and `import.source()` are correctly generated

Closes #13971

🤖 Generated with [Claude Code](https://claude.ai/code)
@graphite-app graphite-app bot force-pushed the fix-import-phase-codegen branch from e65ee4d to 8f3f460 Compare September 21, 2025 13:38
@graphite-app graphite-app bot merged commit 8f3f460 into main Sep 21, 2025
25 checks passed
@graphite-app graphite-app bot deleted the fix-import-phase-codegen branch September 21, 2025 13:44
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codegen: missing . when printing import.defer

2 participants