parcel-bundler / parcel-bundler/lightningcss
Allow for visitor ordering or multi-pass configurations
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
It seems all the issues I've encountered with lightningcss involve the inability to visit a token more than once or to control visitor ordering. If you set a no-op FunctionExit visitor, a function will be visited after its arguments, but then it won't get minified because it has already been visited. Perhaps it should be possible to set a FunctionExit visitor that does nothing but imply a function should be evaluated after its arguments without overriding the function's behavior... or this could be the default (wherein functions are always evaluated after arguments). Or a visitor to a token could be configured to occur before other tokens.
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
Start by tracing how lightningcss handles visitor traversal, particularly FunctionExit visitors and function arguments. Compare the current single-visit behavior with the requested multi-pass or configurable ordering alternatives, then define tests that demonstrate the intended ordering and confirm that functions are still minified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100