Skip to content

Commit 73366ff

Browse files
committed
chore: merge origin main
2 parents 2a51978 + 6b6bb23 commit 73366ff

96 files changed

Lines changed: 5297 additions & 397 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-dylint.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI-Dylint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
paths:
7+
- '.github/workflows/ci-dylint.yaml'
8+
- '.github/actions/rustup/**'
9+
- 'crates/**'
10+
- 'linting/**'
11+
- 'Cargo.lock'
12+
- 'Cargo.toml'
13+
- 'rust-toolchain.toml'
14+
merge_group:
15+
types: [checks_requested]
16+
workflow_dispatch:
17+
push:
18+
branches:
19+
- main
20+
- v1.x
21+
paths:
22+
- '.github/workflows/ci-dylint.yaml'
23+
- '.github/actions/rustup/**'
24+
- 'crates/**'
25+
- 'linting/**'
26+
- 'Cargo.lock'
27+
- 'Cargo.toml'
28+
- 'rust-toolchain.toml'
29+
tags-ignore:
30+
- '**'
31+
32+
jobs:
33+
dylint:
34+
name: Dylint
35+
runs-on: ${{ fromJSON(vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"') }}
36+
steps:
37+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
38+
39+
- name: Install Rust Toolchain
40+
uses: ./.github/actions/rustup
41+
with:
42+
save-if: true
43+
key: dylint
44+
45+
- name: Run Cargo codegen
46+
run: cargo codegen
47+
48+
- name: Install Dylint Toolchain
49+
run: rustup toolchain install nightly-2025-10-31 -c rustc-dev -c llvm-tools-preview -c rust-src
50+
51+
- name: Install cargo-dylint
52+
run: cargo install cargo-dylint dylint-link --locked
53+
54+
- name: Test rspack_collection_hasher
55+
working-directory: linting/rspack_collection_hasher
56+
run: cargo test --lib
57+
58+
- name: Run dylint
59+
run: cargo dylint --all

.github/workflows/release-canary.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ permissions:
3535
jobs:
3636
get-runner-labels:
3737
name: Get Runner Labels
38+
if: ${{ github.repository == 'web-infra-dev/rspack' }}
3839
uses: ./.github/workflows/get-runner-labels.yml
3940
with:
4041
force-use-github-runner: true
4142

4243
build:
4344
name: Build Canary
45+
if: ${{ github.repository == 'web-infra-dev/rspack' }}
4446
needs: [get-runner-labels]
4547
strategy:
4648
fail-fast: false
@@ -76,6 +78,7 @@ jobs:
7678

7779
release:
7880
name: Release Canary
81+
if: ${{ github.repository == 'web-infra-dev/rspack' }}
7982
runs-on: ubuntu-latest
8083
needs: build
8184
environment: npm-canary

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ version = "0.100.0-beta.6"
1515

1616
[workspace.metadata.cargo-shear]
1717
ignored = ["swc", "rspack"]
18+
19+
[workspace.metadata.dylint]
20+
libraries = [{ path = "linting/*" }]
21+
1822
[workspace.dependencies]
1923
aho-corasick = { version = "1.1.4", default-features = false }
2024
anyhow = { version = "1.0.102", default-features = false, features = ["backtrace", "std"] }
@@ -439,7 +443,10 @@ unused_lifetimes = "warn"
439443
unused_macro_rules = "warn"
440444

441445
[workspace.lints.rust.unexpected_cfgs]
442-
check-cfg = ['cfg(allocative)']
446+
check-cfg = [
447+
'cfg(allocative)',
448+
'cfg(dylint_lib, values("rspack_collection_hasher"))',
449+
]
443450
level = "warn"
444451

445452
[workspace.lints.clippy]

crates/rspack/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ loaders = ["loader_lightningcss", "loader_preact_refresh", "loader
1919
bitflags = { workspace = true }
2020
derive_more = { workspace = true }
2121
enum-tag = { workspace = true }
22-
indexmap = { workspace = true, features = ["rayon"] }
2322
regex = { workspace = true }
2423
rspack_browserslist = { workspace = true }
2524
rspack_core = { workspace = true }
@@ -54,6 +53,7 @@ rspack_plugin_swc_js_minimizer = { workspace = true }
5453
rspack_plugin_wasm = { workspace = true }
5554
rspack_plugin_worker = { workspace = true }
5655
rspack_tasks = { workspace = true }
56+
rspack_util = { workspace = true }
5757
# Loaders
5858
rspack_loader_lightningcss = { workspace = true, optional = true }
5959
rspack_loader_preact_refresh = { workspace = true, optional = true }

crates/rspack/src/builder/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mod target;
99
pub use builder_context::BuilderContext;
1010
pub use devtool::Devtool;
1111
use rspack_tasks::CURRENT_COMPILER_CONTEXT;
12+
use rspack_util::fx_hash::FxIndexMap;
1213
pub use target::Targets;
1314

1415
macro_rules! d {
@@ -39,7 +40,6 @@ use builder_context::BuiltinPluginOptions;
3940
use derive_more::Debug;
4041
use devtool::DevtoolFlags;
4142
use externals::ExternalsPresets;
42-
use indexmap::IndexMap;
4343
use regex::Regex;
4444
use rspack_core::{
4545
AssetParserDataUrl, AssetParserDataUrlOptions, AssetParserOptions, BoxPlugin, ByDependency,
@@ -569,7 +569,7 @@ pub struct CompilerOptionsBuilder {
569569
/// The environment in which the code should run.
570570
target: Option<Targets>,
571571
/// The entry point of the application.
572-
entry: IndexMap<String, EntryDescription>,
572+
entry: FxIndexMap<String, EntryDescription>,
573573
/// External libraries that should not be bundled.
574574
externals: Option<Vec<ExternalItem>>,
575575
/// The type of externals.
@@ -1382,11 +1382,10 @@ fn get_resolve_defaults(mode: Mode, target_properties: &TargetProperties, css: b
13821382

13831383
// Add CSS dependencies if enabled
13841384
if css {
1385-
let mut style_conditions = vec!["webpack".to_string()];
1386-
style_conditions.push(match mode {
1385+
let mut style_conditions = vec![match mode {
13871386
Mode::Development => "development".to_string(),
13881387
_ => "production".to_string(),
1389-
});
1388+
}];
13901389
style_conditions.push("style".to_string());
13911390

13921391
by_dependency.push((
@@ -2657,7 +2656,7 @@ impl OutputOptionsBuilder {
26572656
target_properties: Option<&TargetProperties>,
26582657
is_affected_by_browserslist: bool,
26592658
development: bool,
2660-
entry: &IndexMap<String, EntryDescription>,
2659+
entry: &FxIndexMap<String, EntryDescription>,
26612660
_future_defaults: bool,
26622661
) -> Result<OutputOptions> {
26632662
let tp = target_properties;

crates/rspack_binding_api/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ use rspack_core::{
115115
use rspack_error::Diagnostic;
116116
use rspack_fs::{IntermediateFileSystem, NativeFileSystem, ReadableFileSystem};
117117
use rspack_tasks::{CURRENT_COMPILER_CONTEXT, CompilerContext, within_compiler_context_sync};
118-
use rustc_hash::FxHashMap;
118+
use rustc_hash::{FxHashMap, FxHashSet};
119119
use swc_core::common::util::take::Take;
120120

121121
use crate::{
@@ -381,8 +381,8 @@ impl JsCompiler {
381381
async move {
382382
compiler
383383
.rebuild(
384-
changed_files.into_iter().collect::<HashSet<_>>(),
385-
removed_files.into_iter().collect::<HashSet<_>>(),
384+
changed_files.into_iter().collect::<FxHashSet<_>>(),
385+
removed_files.into_iter().collect::<FxHashSet<_>>(),
386386
)
387387
.await
388388
.to_napi_result_with_message(|e| {

crates/rspack_binding_api/src/raw_options/raw_builtins/raw_lazy_compilation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rspack_core::{CompilationId, CompilerId, Module, ModuleIdentifier};
1010
use rspack_napi::threadsafe_function::ThreadsafeFunction;
1111
use rspack_plugin_lazy_compilation::{Backend, LazyCompilationTest, LazyCompilationTestCheck};
1212
use rspack_regex::RspackRegex;
13+
use rustc_hash::FxHashSet as HashSet;
1314

1415
use crate::module::ModuleObject;
1516

@@ -86,15 +87,15 @@ pub struct RawModuleInfo {
8687

8788
#[napi(object, object_to_js = false)]
8889
pub struct RawLazyCompilationOption {
89-
pub current_active_modules: ThreadsafeFunction<(), std::collections::HashSet<String>>,
90+
pub current_active_modules: ThreadsafeFunction<(), HashSet<String>>,
9091
pub test: Option<RawLazyCompilationTest>,
9192
pub entries: bool,
9293
pub imports: bool,
9394
pub client: String,
9495
}
9596

9697
pub(crate) struct JsBackend {
97-
current_active_modules: ThreadsafeFunction<(), std::collections::HashSet<String>>,
98+
current_active_modules: ThreadsafeFunction<(), HashSet<String>>,
9899
}
99100

100101
impl std::fmt::Debug for JsBackend {

crates/rspack_binding_api/src/rsdoctor.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use rspack_plugin_rsdoctor::{
1313
RsdoctorSideEffect, RsdoctorSideEffectLocation, RsdoctorSourcePosition, RsdoctorSourceRange,
1414
RsdoctorStatement, RsdoctorVariable,
1515
};
16+
use rustc_hash::FxHashSet;
1617

1718
#[napi(object)]
1819
pub struct JsRsdoctorModule {
@@ -582,27 +583,27 @@ impl From<RawRsdoctorPluginOptions> for RsdoctorPluginOptions {
582583

583584
Self {
584585
module_graph_features: match value.module_graph_features {
585-
Either::A(true) => HashSet::from([
586+
Either::A(true) => FxHashSet::from_iter([
586587
RsdoctorPluginModuleGraphFeature::ModuleGraph,
587588
RsdoctorPluginModuleGraphFeature::ModuleIds,
588589
RsdoctorPluginModuleGraphFeature::ModuleSources,
589590
]),
590-
Either::A(false) => HashSet::new(),
591+
Either::A(false) => FxHashSet::default(),
591592
Either::B(features) => features
592593
.into_iter()
593594
.map(RsdoctorPluginModuleGraphFeature::from)
594-
.collect::<HashSet<_>>(),
595+
.collect::<FxHashSet<_>>(),
595596
},
596597
chunk_graph_features: match value.chunk_graph_features {
597-
Either::A(true) => HashSet::from([
598+
Either::A(true) => FxHashSet::from_iter([
598599
RsdoctorPluginChunkGraphFeature::ChunkGraph,
599600
RsdoctorPluginChunkGraphFeature::Assets,
600601
]),
601-
Either::A(false) => HashSet::new(),
602+
Either::A(false) => FxHashSet::default(),
602603
Either::B(features) => features
603604
.into_iter()
604605
.map(RsdoctorPluginChunkGraphFeature::from)
605-
.collect::<HashSet<_>>(),
606+
.collect::<FxHashSet<_>>(),
606607
},
607608
source_map_features,
608609
}

0 commit comments

Comments
 (0)