summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-19 21:36:35 +0100
committerGitHub <noreply@github.com>2024-08-19 22:36:35 +0200
commitb5051e25c219c188f17d499ee4e101a64eb62e37 (patch)
tree88c6ab12aefd491d52e638c6e5043728412bca9b /cli/main.rs
parentbf510544ef26b89d4c2ae935893eaf62995ed903 (diff)
feat: Deprecate "import assertions" with a warning (#24743)
This commit deprecates "import assertions" proposal that has been replaced with "import attributes". Any time an import assertion is encountered a warning will be printed to the terminal. This warning will be printed for both local and remote files (ie. user code and dependencies). Import assertions support will be removed in Deno 2.
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/main.rs b/cli/main.rs
index aafa7f009..6a7575dee 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -438,11 +438,15 @@ fn resolve_flags_and_init(
DenoSubcommand::Lsp => vec!["--max-old-space-size=3072".to_string()],
_ => {
if *DENO_FUTURE {
+ // TODO(bartlomieju): I think this can be removed as it's handled by `deno_core`
+ // and its settings.
// deno_ast removes TypeScript `assert` keywords, so this flag only affects JavaScript
// TODO(petamoriken): Need to check TypeScript `assert` keywords in deno_ast
vec!["--no-harmony-import-assertions".to_string()]
} else {
vec![
+ // TODO(bartlomieju): I think this can be removed as it's handled by `deno_core`
+ // and its settings.
// If we're still in v1.X version we want to support import assertions.
// V8 12.6 unshipped the support by default, so force it by passing a
// flag.
@@ -455,6 +459,7 @@ fn resolve_flags_and_init(
};
init_v8_flags(&default_v8_flags, &flags.v8_flags, get_v8_flags_from_env());
+ // TODO(bartlomieju): remove last argument in Deno 2.
deno_core::JsRuntime::init_platform(None, !*DENO_FUTURE);
util::logger::init(flags.log_level);