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.
This commit is contained in:
Bartek Iwańczuk 2024-08-19 21:36:35 +01:00 committed by GitHub
parent bf510544ef
commit b5051e25c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 102 additions and 11 deletions

View file

@ -80,6 +80,10 @@ impl CodeCache {
data,
));
}
pub fn remove_code_cache(&self, specifier: &str) {
Self::ensure_ok(self.inner.remove_code_cache(specifier))
}
}
impl code_cache::CodeCache for CodeCache {
@ -158,6 +162,15 @@ impl CodeCacheInner {
self.conn.execute(sql, params)?;
Ok(())
}
pub fn remove_code_cache(&self, specifier: &str) -> Result<(), AnyError> {
let sql = "
DELETE FROM codecache
WHERE specifier=$1;";
let params = params![specifier];
self.conn.execute(sql, params)?;
Ok(())
}
}
fn serialize_code_cache_type(