parcel-bundler / parcel-bundler/lightningcss
Wrong selector output
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to convert a sequence of tokens (from a custom-function) into a selector list.
For example (as seen in the repro), if we have * + * parsed as a token list:
[
{ type: 'token', value: { type: 'delim', value: '*' } },
{ type: 'token', value: { type: 'white-space', value: ' ' } },
{ type: 'token', value: { type: 'delim', value: '+' } },
{ type: 'token', value: { type: 'white-space', value: ' ' } },
{ type: 'token', value: { type: 'delim', value: '*' } }
]
the output selector list should be
[
{ type: 'universal' },
{ type: 'combinator', value: 'descendant' },
{ type: 'combinator', value: 'next-sibling' },
{ type: 'combinator', value: 'descendant' },
{ type: 'universal' }
]
the expected output should be * + *, but it emits * *+.
Version-wise, this used to work in 1.19 and 1.20, stopped working in 1.21
Edit: it seems in <1.21, whitespace token is always skipped, whereas in >1.21, it is included.
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 with the playground reproduction and compare selector conversion behavior between versions 1.20 and 1.21. Trace how custom-function token lists handle whitespace and combinators; done means the supplied * + * tokens produce the expected selector list and serialize as * + *.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust
- Domain
- compilers, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100