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

feat: Add ImportAssertionsSupport #853

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

bartlomieju
Copy link
Member

Needed for denoland/deno#24743.

Comment on lines 606 to 621
eprintln!("⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.");
if let Some(specifier) = maybe_script_resource_name {
if let Some(source_line) = maybe_source_line {
eprintln!();
eprintln!("{}", source_line.to_rust_string_lossy(scope));
eprintln!();
eprintln!("{:0width$}^^^^^^", " ", width = start_column);
}
eprintln!(
" at {}:{}:{}",
specifier.to_rust_string_lossy(scope),
maybe_line_number.unwrap(),
start_column
);
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This prints a message like:

⚠️  Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.

import data from "./data.json" assert { type: "json" };

                               ^^^^^^
  at file:///Users/ib/dev/deno/foo.js:1:31

Kinda feel we might want to reuse it in the CLI, just print it in yellow (with a Warning: prefix). Need to figure out how to easily share it

@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 70 lines in your changes missing coverage. Please review.

Project coverage is 81.52%. Comparing base (0c7f83e) to head (6c80122).
Report is 84 commits behind head on main.

Files Patch % Lines
core/runtime/jsruntime.rs 20.27% 59 Missing ⚠️
core/runtime/setup.rs 56.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #853      +/-   ##
==========================================
+ Coverage   81.43%   81.52%   +0.08%     
==========================================
  Files          97       98       +1     
  Lines       23877    24919    +1042     
==========================================
+ Hits        19445    20316     +871     
- Misses       4432     4603     +171     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 766e39d into denoland:main Aug 1, 2024
18 checks passed
@bartlomieju bartlomieju deleted the import_assertions_support branch August 1, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants