parcel-bundler / parcel-bundler/lightningcss
Add `Clone`, `Copy` & `Debug` to `PrinterOptions`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
I'd love to see Clone, Copy and Debug implemented for PrinterOptions<'a>.
Especially the first one - it would be very nice to quickly re-use the same options between different to_css invocations.
Clone & Copy
As far as I understand, the main reason this is not implemented, is source_map that is passed as mutable reference. That indeed
prevents us from cloning the printer.
However, note, that this field is behind sourcemap feature. Therefore I would recommend adding:
#[cfg_attr(not(feature = "source map"), derive(Clone, Copy))]
Debug
I don't see a reason why this is not implemented. I guess it was never needed but it is a nice QoL improvement.
Other structures
Other structures would also need the change - at least DependencyOptions and PseudoClasses. It seems that Targets already implements all three traits.
I'd love to create a PR with those improvements.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate PrinterOptions, DependencyOptions, PseudoClasses, and Targets, then compare the trait implementations already present on Targets. Check how the source_map feature affects PrinterOptions and verify that the requested Clone, Copy, and Debug implementations are consistent across these structures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100