Skip to content

chore: take crates name#2

Merged
hyf0 merged 1 commit intomainfrom
take-name
Apr 6, 2022
Merged

chore: take crates name#2
hyf0 merged 1 commit intomainfrom
take-name

Conversation

@hardfist
Copy link
Contributor

@hardfist hardfist commented Apr 6, 2022

No description provided.

@@ -0,0 +1,10 @@
[package]
name = "rspack-node-resolve"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake_case will be more appropriate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

@hyf0 hyf0 merged commit 46d8064 into main Apr 6, 2022
@hardfist hardfist deleted the take-name branch March 3, 2023 06:05
hardfist pushed a commit that referenced this pull request Oct 23, 2025
…11978)

* chore: Add Claude Code GitHub Workflow (#1)

## 🤖 Installing Claude Code GitHub App

This PR adds a GitHub Actions workflow that enables Claude Code
integration in our repository.

### What is Claude Code?

[Claude Code](https://claude.com/claude-code) is an AI coding agent that
can help with:
- Bug fixes and improvements  
- Documentation updates
- Implementing new features
- Code reviews and suggestions
- Writing tests
- And more!

### How it works

Once this PR is merged, we'll be able to interact with Claude by
mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and
surrounding context, and execute on the request in a GitHub action.

### Important Notes

- **This workflow won't take effect until this PR is merged**
- **@claude mentions won't work until after the merge is complete**
- The workflow runs automatically whenever Claude is mentioned in PR or
issue comments
- Claude gets access to the entire PR or issue context including files,
diffs, and previous comments

### Security

- Our Anthropic API key is securely stored as a GitHub Actions secret
- Only users with write access to the repository can trigger the
workflow
- All Claude runs are stored in the GitHub Actions run history
- Claude's default tools are limited to reading/writing files and
interacting with our repo by creating comments, branches, and commits.
- We can add more allowed tools by adding them to the workflow file
like:

```
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
```

There's more information in the [Claude Code action
repo](https://github.com/anthropics/claude-code-action).

After merging this PR, let's try mentioning @claude in a comment on any
PR to get started!

* chore: Configure autodev

* refactor(core): Convert BoxModule from type alias to newtype struct (#2)

## Summary
This PR refactors `BoxModule` from a simple type alias to a newtype
struct pattern for improved type safety and better encapsulation while
maintaining all existing functionality.

## Objective
Refactor `BoxModule` in `crates/rspack_core/src/module.rs` from a type
alias to a newtype struct pattern. This change improves type safety and
provides better encapsulation while maintaining all existing
functionality.

## Current Implementation
Previously, `BoxModule` was defined as:
```rust
pub type BoxModule = Box<dyn Module>;
```

## New Implementation
Now `BoxModule` is a newtype struct:
```rust
#[cacheable(with=AsInner)]
#[repr(transparent)]
pub struct BoxModule(Box<dyn Module>);
```

## Changes Made

### Core Module (`crates/rspack_core/src/module.rs`)
- Converted `BoxModule` from type alias to newtype struct
- Implemented essential traits:
- **Deref/DerefMut**: Allow transparent access to `Box<dyn Module>`
methods
  - **From<Box<dyn Module>>**: Enable ergonomic construction
  - **AsRef/AsMut**: Provide reference conversions
  - **Debug**: Forward to inner type's Debug implementation
  - **Identifiable**: Forward to inner module's identifier method
  - **AsInnerConverter**: Enable cacheable serialization support
- Added `BoxModule::new()` constructor method
- Updated `ModuleExt::boxed()` to return `BoxModule`

### Compilation & Module Management
- Updated `BuildTask` and `AddTask` to use `BoxModule`
- Fixed type conversions across module factories
- Updated module graph operations for proper deref coercion

### Plugin Updates (19 files changed)
- **rspack_plugin_devtool**: Fixed borrow checker issues
- **rspack_plugin_dll**: Updated DLL and delegated module factories
- **rspack_plugin_extract_css**: Updated CSS module factory
- **rspack_plugin_javascript**: Fixed ESM dependency checks
- **rspack_plugin_lazy_compilation**: Updated proxy module creation
- **rspack_plugin_mf**: Updated container and sharing module factories
- **rspack_plugin_split_chunks**: Fixed module reference handling

## Benefits
- **Type Safety**: Prevents accidental mixing with other boxed types
- **Better Encapsulation**: Private inner field with clear API boundary
- **Zero-Cost Abstraction**: `#[repr(transparent)]` ensures no runtime
overhead
- **Improved Maintainability**: Single, well-defined interface for
module boxing

## Compatibility
- All existing code continues to work due to `Deref` coercion
- The `.boxed()` helper provides ergonomic module creation
- Cacheable serialization works seamlessly

## Testing
- [x] `cargo check --workspace` passes without errors
- [ ] `cargo test --workspace` (pending)
- [x] All type conversions compile correctly
- [x] Deref coercion works as expected

## References
- Rust newtype pattern:
https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html
- Rust Book - Advanced Types:
https://doc.rust-lang.org/book/ch19-04-advanced-types.html
- Effective Rust - Newtype Pattern:
https://www.lurklurk.org/effective-rust/newtype.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Revert "chore: Configure autodev"

This reverts commit ae36c58.

* Revert "chore: Add Claude Code GitHub Workflow (#1)"

This reverts commit 4764c86.

---------

Co-authored-by: delino[bot] <235003666+delino[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 21, 2026

Deploying rspack-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: a248d9c
Status: ✅  Deploy successful!
Preview URL: https://56763eea.rspack-v2.pages.dev
Branch Preview URL: https://main.rspack-v2.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 21, 2026

Deploying rspack-v1 with  Cloudflare Pages  Cloudflare Pages

Latest commit: a065139
Status: ✅  Deploy successful!
Preview URL: https://1b94626b.rspack-v1.pages.dev
Branch Preview URL: https://main.rspack-v1.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 26, 2026

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: a060398
Status: ✅  Deploy successful!
Preview URL: https://705d6b62.rspack-v2.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants