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

chore: cleanup for avoiding meaningless diff with more-js-api-v2 #9499

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ jobs:
uses: ./.github/actions/pnpm-cache
with:
run-install: false

- name: Run Cargo Check
run: cargo check --workspace --all-targets --locked # Not using --release because it uses too much cache, and is also slow.

Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion crates/rspack_loader_runner/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use regex::Regex;
use rspack_cacheable::cacheable_dyn;
use rspack_collections::{Identifiable, Identifier};
use rspack_error::Result;
use rspack_paths::Utf8PathBuf;
use rspack_paths::{Utf8Path, Utf8PathBuf};
use rspack_util::identifier::strip_zero_width_space_for_fragment;

use super::LoaderContext;
Expand Down Expand Up @@ -62,6 +62,21 @@ impl<C> LoaderItem<C> {
self.request
}

#[inline]
pub fn path(&self) -> &Utf8Path {
&self.path
}

#[inline]
pub fn query(&self) -> Option<&str> {
self.query.as_deref()
}

#[inline]
pub fn fragment(&self) -> Option<&str> {
self.fragment.as_deref()
}

#[inline]
pub fn r#type(&self) -> &str {
&self.r#type
Expand Down
1 change: 0 additions & 1 deletion crates/rspack_plugin_copy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dashmap = { workspace = true }
derive_more = { workspace = true, features = ["debug"] }
futures = { workspace = true }
glob = { workspace = true }
lazy_static = "1.5.0"
pathdiff = { workspace = true, features = ["camino"] }
regex = { workspace = true }
rspack_core = { workspace = true }
Expand Down
8 changes: 3 additions & 5 deletions crates/rspack_plugin_copy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
hash::Hash,
ops::DerefMut,
path::{Path, PathBuf, MAIN_SEPARATOR},
sync::{Arc, Mutex},
sync::{Arc, LazyLock, Mutex},
};

use dashmap::DashSet;
Expand Down Expand Up @@ -131,10 +131,8 @@ pub struct CopyRspackPlugin {
pub patterns: Vec<CopyPattern>,
}

lazy_static::lazy_static! {
/// This is an example for using doc comment attributes
static ref TEMPLATE_RE: Regex = Regex::new(r"\[\\*([\w:]+)\\*\]").expect("This never fail");
}
static TEMPLATE_RE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"\[\\*([\w:]+)\\*\]").expect("This never fail"));

impl CopyRspackPlugin {
pub fn new(patterns: Vec<CopyPattern>) -> Self {
Expand Down
Loading