-
-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed bug on jss-plugin-nested #1591
Conversation
Great. See also: |
parseSelectors, | ||
flatMapSelectors, | ||
selectorsToString, | ||
} from '@cssfn/css-selector' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid we can't do this, its a huge bundle-size increase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a solution that is super minimalistic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow did you write the selector parser to fix this bug? If so huge props in any case!
But jss is runtime-executed, it gets bundled with a client-side app, the only way forward is to reduce the size, even potentially remove features to make it small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyymarco wow dude! thats some serious work!
please reopen once you have time to continue |
Feel free to fix a bug with a proper test and I will merge it.
Oleg
… On 19. Apr 2022, at 09:24, Daniil ***@***.***> wrote:
This bug is from version 10.0.1 (more one year!!). Shouldn't it be fixed by the current library team? Part of my team is giving up on jss, as well as some people I know because of this problem. I honestly don't quite understand the point of preparing a move to 18 React if there are such critical bugs
Sorry if I offended or don't understand your processes, I'm speaking as a regular consumer of your library
—
Reply to this email directly, view it on GitHub <#1591 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAM4WEBOPNFAETL2QRPHFDVFZUUVANCNFSM5JK7XM5Q>.
You are receiving this because you modified the open/close state.
|
According a bug on here
The bug is here:
it split the string by comma, but imagine a selector like this:
&.hello, &.world:is(.awesome, .good, .bad)
it will splitted to:
it's incorrect, and should be:
and the another bug is with the parent selector
&
.Imagine if a selector like this:
&.hello, &.world[data-message="you & me"]
The
&
inside"you & me"
is not a parent selector, it's just a string expression.To solve the 2 problem above, i wrote a selector parser,
you can see (and maybe make more perfection) here: see my repo.
The parser is smart enough to distinguish between parent selector, universal selector, combinators, string expression, and so on.
The usage is simple:
parseSelector
=>flatMapSelectors
(replace&
with something) =>selectorsToString
.the package published with es9 format, but you can fork & re-transpile to es5.