Repository navigation
Let users disable hiding some newsfeed events - #988
Conversation
|
It's not just a couple of more lines. It also means it will happen much slower since it has the execute the JS before hiding instead of just being in the CSS. |
|
@sindresorhus True, But I think many users will be very happy with this addition. |
|
I don't think we should do this. It's a slippery slope and not how we should handle opt-out of CSS. There are better ways to enable opting out of CSS changes than rewriting it to JS. We should always prefer CSS when possible. |
|
@yakov116 This extension has 10.000 users and only a few have complained so far. |
|
@sindresorhus True. Not that it makes a diff, I recompile just because of this change. |
The script is always run before the first paint so this shouldn't happen. All of RGH's JS still needs to be parsed/executed before the first paint so it really is no more than a couple additional calls. It can be shortened to I don't see much of a problem with something as simple as this, but if it looks too much like a slipper slope we can just close #747 and direct everyone to undo the change with Stylish. |
|
I'm not against the intention of the change, just feel that we should rather solve the problem of many disabled features depending on CSS and how to have it disabled too, rather rewriting all of the dependent CSS in JS. |
Same solution: leave the rules in the CSS but hide them behind a class.
Such as? Stylish? That's not always easy though. In this case it's just a |
But I would like the inverse. I don't want to make the default case worse in any way, even if it's super minor (It adds up). |
|
I can't really think of a good solution right now though. Maybe a compromise would be to, as soon as |
I don't think such solution exists. Either way there's some more code to write/parse/execute/maintain and it's nothing saved (we can discuss this on a case by case basis)
We don't have a list of features, it's just filenames, unless there's a webpack plugin that adds the array of modules to the bundle.
This is essentially what this PR does, except it's localized in its own feature file instead of being global. It doesn't get any faster than this (i.e. run in |
Would be easy to make that if needed.
I just don't like using JS for something that already works fine with CSS. You're right, this is just a one-line thing, but this opens the door for people to ask about CSS changes to other disabled features too. Shouldn't we think further ahead than just this change? |
|
We’re talking about two separate things in the same discussion:
For this specific PR: it’s fine either way. I’d merge it because even 10 of these aren’t a big deal to me and the user request makes sense. We can also close this because this specific feature can easily be undone via Stylish. |
|
Yeah, gonna merge this since it's such a tiny change and many seem to want it. I do think we should discuss a better way to handle the CSS of features at some point though. |
Wait for the next feature or open a new issue now? :) |
|
We can wait for the next feature. Easier to discuss something based on actual code. |
Is #1122 a good candidate for discussion? I don't think that there's a better solution than hiding the CSS behind a class like in https://github.com/sindresorhus/refined-github/pull/1089/files#diff-a58403778295001c22a20116c193c4a1 The class is added right after |
Not really. See my comment there. |
I figured a couple more lines of code are worth it
Closes #747