parcel-bundler / parcel-bundler/lightningcss
Minification can benefit from using single quotation marks on strings
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
If the string contains double quotation marks and not single quotation marks, it’s more compact to use single quotation marks.
For example, if the source contains this:
content:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="red" d="…"/></svg>')
Lightning CSS will currently make it more verbose by using double quotes on the string:
content: url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\"><path fill=\"red\" d=\"…\"/></svg>")
(… the other approach that could be taken in this particular case would be to parse the URL and change the SVG to use single quotes, but that’s not a general technique!)
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
The issue names no file, test, or entry point. Start by reproducing the CSS example in Lightning CSS and trace the minifier’s string-quoting decision. Done means output uses single quotes when that requires fewer escapes without changing semantics, with regression coverage for the shown case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100