-
Notifications
You must be signed in to change notification settings - Fork 253
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
Remove 'no-js' non-JS fallback mechanism #2899
Conversation
It has been not used, and not working where it is used, for some time. Remove non-effective approach. ref #2850
I am -0 on this, as I know of at least one downstream application that depends on this mechanism being available from upstream. This should not be taken to imply that it should not be removed, but its removal should be highlighted in release notes along with some pointers about reinstating the behavior for downstream applications that rely on it. |
(I think you mean If we leave it, I guess we should create an issue to make it work for the sort-and-pagination area, where it currently does not? Hm, another option would be leaving the mechanism there, but simply removing the non-working no-js CSS for sort-and-pagination. So the mechanism would still be there for anything downstream that uses it, but nothing in blacklight core would actually use it? (Right now, one thing tries to use it, but not succesfully). Opinions on that @adjam or others? |
"-0" means "I don't like this change/this change has negative effects, but I'm not voting against it." The context is that the project has CSS rules that match on |
Would you be interested in helping to write those release notes, @adjam , with your understanding of the use case for them? I am not sure where we put release notes to "hold" them until the release, I don't know how this works in BL release practices. |
Adam might be -0, but I'm -1. Completely removing the ability for users without javascript enabled to use controls seems like a step backwards. When I disable javascript, I see these controls: and they seem to work for me. The flash of unstyled content seems like a regression (only for certain asset pipeines?) and we could fix it easily by
(e.g. #2901, which seems to work for me using importmaps 🤷♂️ ) |
a) @cbeer there are other controls in BL that users without JS cannot use, such as the facet sidebars, agree? the -only- controls that have an attempt at non-JS fallback are sort-and-per-page. That made me think this is not something that BL community actually cared about, it was just leftover from another era and not maintained. But are you saying instead that sort-and-per-page controls are especially important to have non-JS fallbacks? b) Interesting, your screenshot does not match mine! Here is what I am seeing on current But your screenshot does not have that overlap. Also mine ends up really squishing the "previous/next" area undesirably, and yours doesn't. (I think the giant square non-interactive blocks are undesirable in both of ours?) Very odd. Are you using a different non-Chrome browser? I just reproduced same as above on Firefox Mac too. I am baffled how you are seeing something different! What browser did you make that screenshot from, and was it on demo.projectblacklight.org? The fact that to me the non-JS fallback looked bad and wrong suggested, and has for years, suggested to me that non-JS fallback wasn't actually a priority for anyone here. c) I don't believe the flash of different content (with page layout moving around) is due to using an unusual method of including javascript. You reproduce it yourself on demo.projectblacklight.org, if in Chrome Dev Tools "Network" tab you choose to "throttle" to "Slow 3G". |
@jrochkind The committers met today and discussed both this and #2902. We talked about the burden of supporting no-JS when we're using Bootstrap and just generally, and the recognition that this has been broken long enough that it feels like progressive enhancement is not a core value of this software that we want to support. In that discussion we made a few decisions:
I want to personally recognize your commitment towards maintainability of software we all depend on, and I'm so thankful for the issues this has brought to the forefront. |
Thanks for the update and clear info on decision! |
There was from way back a mechanism used in Blacklight code where body tag has a 'no-js' class, and Javascript once loaded removes that class and adds a 'js' class. This is meant to support having CSS fallbacks to make sure display and interactive elements work properly even if the user-agent has no JS, that then get "enhanced" to JS versions once JS loads. Sometimes called "unobtrusive Javscript" or other names.
However, I could only find one place in code that attempts to use this mechanism, around the sort-and-per-page dropdowns. AND I don't believe it is actually working properly, I don't believe it succesfully provides a working non-JS alternative. See screenshots at #2850. I first noticed it not working some time ago, I beleive it's been non-working for a while.
there are plenty of other UI elements which simply do not work without JS -- facet sidebar for instance. BL in general has not kept up trying to provide non-JS fallbacks, generally BL does not work without JS.
Another downside of this approach is that if you are on a slow computer or network connection, you can get a flash of the "non-JS" alternative before the JS loads to change it to the JS alternative. Which in this case with the non-working non-JS alternative, means you get a flash of something which simply doesn't look right, and also causes the page to shift around a whole lot when the JS finally does load. Which would be considered a trade-off to weigh against the benefit of non-JS support, I guess, if the non-JS support actually worked, but.
So I propose removing this mechanism entirely. It is not working, has been not working for some time, let's remove it to simplify code. If someone wants to add working non-JS fallback again in the future, that can be another PR.