8000 feat(biome_js_parser): support defer attribute in import statements by fireairforce · Pull Request #4301 · biomejs/biome · GitHub
[go: up one dir, main page]

Skip to content

feat(biome_js_parser): support defer attribute in import statements - #4301

Merged
ah-yu merged 2 commits into
biomejs:mainfrom
fireairforce:feat-4215
Oct 15, 2024
Merged

ah-yu merged 2 commits into
biomejs:mainfrom
fireairforce:feat-4215

Conversation

@fireairforce
Copy link
Copy Markdown
Member

Summary

closes: #4215

Test Plan

@github-actions github-actions Bot added A-Parser Area: parser A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages labels Oct 15, 2024
@fireairforce
fireairforce marked this pull request as ready for review October 15, 2024 08:03
@github-actions github-actions Bot added A-Formatter Area: formatter A-Changelog Area: changelog labels Oct 15, 2024
Comment thread crates/biome_js_parser/src/syntax/module.rs 10BC8 Resolved
@codspeed
codspeed Bot commented Oct 15, 2024 •
Copy link
Copy Markdown
Contributor

CodSpeed Performance Report

Merging #4301 will improve performances by 6.06%

Comparing fireairforce:feat-4215 (2286c37) with main (561b54c)

Summary

⚡ 1 improvements
✅ 104 untouched benchmarks

Benchmarks breakdown

Benchmark main fireairforce:feat-4215 Change
⚡ db_17847247775464589309.json[cached] 14.1 ms 13.3 ms +6.06%

@ah-yu ah-yu left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you

@ah-yu
ah-yu merged commit 27ff2a7 into biomejs:main Oct 15, 2024
@ematipico ematipico left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@fireairforce can you please follow up with another PR and address my comments? I think there are some cases that we need to cover

Comment thread CHANGELOG.md

#### New features

- JS Parser support defer attribute in import statements ([#4215](https://github.com/biomejs/biome/issues/4215)).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- JS Parser support defer attribute in import statements ([#4215](https://github.com/biomejs/biome/issues/4215)).
- Add support for parsing the defer attribute in import statements ([#4215](https://github.com/biomejs/biome/issues/4215)).

Comment thread xtask/codegen/js.ungram
Comment on lines 1254 to +1255
'type'?
'defer'?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this correct? Did you check if typescript will add the keyword defer after type? It would be nice if you could provide this information at least in the PR description

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is wrong, microsoft/TypeScript#59391, so maybe i need to support a new data structure like JsDeferImportNamespaceClause to support this case:

JsDeferImportNamespaceClause =
	'defer'?
	namespace_specifier: JsNamespaceImportSpecifier
	'from'
	source: AnyJsModuleSource
	assertion: JsImportAssertion?

What do you think?

Comment on lines +297 to +298
// test js import_defer_clause
// import defer * as yNamespace from "y";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

import type defer * as yNamespace from "y"; is missing, we should add a test case for that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this case maybe need to be an error.

@fireairforce
Copy link
Copy Markdown
Member Author

ok, i will follow this later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Changelog Area: changelog A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📎 Add support for the defer attribute in import statements

3 participants

0