Skip to content

Commit 45c464f

Browse files
committed
chore(turbopack): Remove unmaintained fxhash crate, use rustc-hash instead
1 parent cdb275c commit 45c464f

File tree

9 files changed

+9
-20
lines changed

9 files changed

+9
-20
lines changed

Cargo.lock

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/napi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ workspace = true
4747
anyhow = "1.0.66"
4848
backtrace = "0.3"
4949
console-subscriber = { workspace = true, optional = true }
50-
fxhash = "0.2.1"
5150
dhat = { workspace = true, optional = true }
5251
indexmap = { workspace = true }
5352
owo-colors = { workspace = true }
@@ -64,6 +63,7 @@ napi = { version = "2", default-features = false, features = [
6463
napi-derive = "2"
6564
next-custom-transforms = { workspace = true }
6665
rand = { workspace = true }
66+
rustc-hash = { workspace = true }
6767
serde = "1"
6868
serde_json = "1"
6969
shadow-rs = { workspace = true }

crates/napi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ use std::{
4141

4242
use backtrace::Backtrace;
4343
use dashmap::DashMap;
44-
use fxhash::FxHashSet;
4544
use napi::bindgen_prelude::*;
45+
use rustc_hash::FxHashSet;
4646
use swc_core::{
4747
base::{Compiler, TransformOutput},
4848
common::{FilePathMapping, SourceMap},

crates/napi/src/minify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ DEALINGS IN THE SOFTWARE.
2727
*/
2828
use std::sync::Arc;
2929

30-
use fxhash::FxHashMap;
3130
use napi::bindgen_prelude::*;
31+
use rustc_hash::FxHashMap;
3232
use serde::Deserialize;
3333
use swc_core::{
3434
base::{config::JsMinifyOptions, try_with_handler, BoolOrDataConfig, TransformOutput},

crates/napi/src/transform.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ use std::{
3636

3737
use anyhow::{anyhow, bail, Context as _};
3838
use dashmap::DashMap;
39-
use fxhash::FxHashSet;
4039
use napi::bindgen_prelude::*;
4140
use next_custom_transforms::chain_transforms::{custom_before_pass, TransformOptions};
4241
use once_cell::sync::Lazy;
42+
use rustc_hash::FxHashSet;
4343
use swc_core::{
4444
base::{try_with_handler, Compiler, TransformOutput},
4545
common::{comments::SingleThreadedComments, errors::ColorConfig, FileName, Mark, GLOBALS},
@@ -87,7 +87,7 @@ impl Task for TransformTask {
8787

8888
fn compute(&mut self) -> napi::Result<Self::Output> {
8989
GLOBALS.set(&Default::default(), || {
90-
let eliminated_packages: Rc<RefCell<fxhash::FxHashSet<String>>> = Default::default();
90+
let eliminated_packages: Rc<RefCell<FxHashSet<String>>> = Default::default();
9191
let use_cache_telemetry_tracker: Rc<DashMap<String, usize>> = Default::default();
9292

9393
let res = catch_unwind(AssertUnwindSafe(|| {

crates/next-custom-transforms/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ workspace = true
1717
chrono = "0.4"
1818
easy-error = "1.0.0"
1919
either = "1"
20-
fxhash = "0.2.1"
2120
hex = "0.4.3"
2221
indexmap = { workspace = true }
2322
indoc = { workspace = true }

crates/next-custom-transforms/src/chain_transforms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::{cell::RefCell, path::PathBuf, rc::Rc, sync::Arc};
22

33
use dashmap::DashMap;
44
use either::Either;
5-
use fxhash::FxHashSet;
65
use modularize_imports;
76
use preset_env_base::query::targets_to_versions;
7+
use rustc_hash::FxHashSet;
88
use serde::Deserialize;
99
use swc_core::{
1010
common::{

crates/next-custom-transforms/src/transforms/next_ssg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{cell::RefCell, mem::take, rc::Rc};
22

33
use easy_error::{bail, Error};
4-
use fxhash::FxHashSet;
4+
use rustc_hash::FxHashSet;
55
use swc_core::{
66
common::{
77
errors::HANDLER,

crates/next-custom-transforms/tests/telemetry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::{cell::RefCell, rc::Rc, sync::Arc};
22

3-
use fxhash::FxHashSet;
43
use next_custom_transforms::transforms::next_ssg::next_ssg;
54
use once_cell::sync::Lazy;
5+
use rustc_hash::FxHashSet;
66
use swc_core::{
77
base::{try_with_handler, Compiler},
88
common::{comments::SingleThreadedComments, FileName, FilePathMapping, SourceMap, GLOBALS},

0 commit comments

Comments
 (0)