-
Notifications
You must be signed in to change notification settings - Fork 22
Remove jquery #453
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
base: main
Are you sure you want to change the base?
Remove jquery #453
Conversation
|
I have time this afternoon and tomorrow to review this! I will try to test it out in my app, and/or a fresh app of some kind. Will I find instructions in the README as to how to include the new JS in my app? I'm getting a bit confused by the README, which seems to still mention jquery+treetable installation? TO BE FAIR -- the README already didn't succesfully include instructions for actually getting started with b-e, and I don't think the generators had been working either with a fresh Rails app! Do you mean to fix that in this PR, should this PR provide a readme/generators that actually work? Or do you mean to leave that unfixed for another day? Thank you for any additional orientation you can give me to reviewing this PR! |
|
Also I think we can defnitely drop Bootstrap 3 support (and even 4 if it's inconvenient?) at this point, for upcoming 2.0 release. |
|
Thank you taking the time to review this work @jrochkind ! Your feedback on the installation experience is very helpful.
You are correct. The
To be completely honest, I have not looked into the state of the Rails generators at all yet, and I'm not familiar with them. So, I might need some time to study this and understand what needs to be done :) The primary goal of this PR was the substantial technical lift of removing Would it be acceptable to address these issues with the generators and a full overhaul of the installation guide in a separate, follow-up PR? I think I didn't add any instructions on how to run this because I didn't notice a difference :)
Hope this helps! Please let me know if you have any questions. |
|
Thanks for that context @Dananji -- and for this work! I think leaving them in the README is fine for now, to keep everything in one place! Before we have a full 2.0 release, I think we need to attend to the installatino process -- but it doesn't need to be part of this PR! I'd say leave em in the README for now, thanks! That context was super helpful for me! |
|
I'm confused about your last instructions... you're saying you cloned THIS repo, and ran The instructions for getting browse-everything installed into your OWN app (not the browse-everything test app!) is the trick -- which is totally not THIS PR's job to solve, cool cool. |
|
I had a comcast outage today and probably ran out of time (and I don't work Fridays), but please ping me again if you don't hear back, i want to provide review comments! Warning, i think I personally may need/want some more discussion to understand goals and ideas for future before I personally put stamp of merge approval on it, maybe @cjcolvar can join us too, or we could even have a zoom about it? But first, I'll finish exploring and leave some review comments! |
|
Thanks for taking the time to PR this and provide context! Removing JQuery was something on my list too, that I wasn't sure how to approach. (I hadn't managed to find wunderbaum, or the other competitors I've now found searching for 'things like wunderbaum'!) The following is a "code review" in the sense of a "book review" -- it's my thoughts and an opening of a discussion, not unilateral commands, I am not the boss of b-e! Would love to have a discussion feedback with @Dananji and @cjcolvar and any other interested parties. We don't need to solve everything in this PR -- but I think we do need to not make things worse. Not always clear what makes things worse. I am still using b-e off this git/release, and will need to upgrade for supporting new Rails or BL or bugfixes, so what's merged to master even temporarily ideally won't make things a lot harder for me. Clear on the goals?My own goals for removing JQuery were primarily a hope of saving bytes in my delivered JS. But this doesn't do that so much, I don't think? All following counts are uncompressed JS.
So if I am able to remove jQuery from my project, it's about the same, a bit bigger. If I'm not, I'm actually adding quite a few bytes. [NOTE Code currently doesn't include the But you may have other reasons than file size to want to eliminate jquery? Let's be clear on them? Maybe this is easier to interact with with JS or CSS to customize? Or the UI is much better? Better browser compat? more accessible? (!?!?) Or other? Regardless, if Avalon is finding this approach good and is really into keeping it, I would be willing to go along and take the bytes hit for now just to get others helping to maintain this instead of just me! But let's be clear about why we're doing it? AccessibiltySub-question -- do we know if wunderkaum is good/better for accessibility? This thing with lots of dynamic content and hide/show disclosures risks being really not accessible, it would be nice to get accessibility with a big change like this. There may be options that are more accessible? I found ui-js-tree-wc that is specifically designed for accessibilty and is very small and has the basic features we might need (but no grid view), but isn't very maintained and might need a lot of custom CSS to add grid layout etc. Icons via alternative to bootstrap-icons?Bootstrap-icons is default icon provision for wunderbaum -- but support for fonticons default actually adds a lot of complexity to this, a lot of special handling for the font, vendoring an additional dependency. wunderbaum allows configuring arbitrary other icons I would strongly recommend we use locally embedded SVG for icons, using data: URIs to actually put the SVG the CSS -- this will remove the need for all that extra handling with bootstrap-icons and make integration a lot easier, including with future improvements. Since bootstrap-icons are MIT licensed, i believe we could even use the very same icons if we like them, but embed them as inline vendoring, can we leave some provenanceCould the new asset integration with local appWe've inherited a bad integration story, where bundler is all that's supported, when bundler is no longer supported by recent Rails, and generators probably don't work with recent rails. It's fine that this PR isn't meant to address that, so just "vendors" all dependencies locally, which was the current status quo. But we don't want to make it harder to make the integration step, or for people to hack out integrations on their own -- this does a bit, by adding a lot more files dependencies, and by making what was before CSS into SCSS. I think removing bootstrap-icons dependency will help. If the .scss could be turned into straight .css, that woudl also help -- a lot of people don't want .scss in their pipelines anymore. I'm not sure if there are any specific features we are using .scss for. And avoiding We may want better instructions in README -- the README started out pretty confused and not always accurate, and the new grid that's there is great for context (I at first didn't realize I had to scroll right to see it all!), but is more like notes (great notes!) for what we might want ot put in README? Testing in my appIn my own app, I don't use bundler, so with previous browse-everything I just copied-pasted all the files to be vendored in my own app. I set out to try a test using that same approach. I got stopped by a couple things. My app used the Additionally, I might want to actually use wunderbaum via an actual npm dependnecy in my app that does use npm dependencies -- i think this should be possible with the JS as it is, but the CSS not sure, the way it uses local SASS I prob could have gotten a local demo in my real app working with more time, but ran out out of it for this review. |
|
@jrochkind Thanks for the feedback! To address your points: Goal and scope: The primary motivation for this PR for me was to remove Accessibility (a11y): Wunderbaum is a re-write of Icons: I agree that adding Testing in app: Would you be able to try the implementation in the dummy-app in this PR? I'll push those icon and a11y changes soon! |
Changes in this PR;
jQueryrelated dependencies from the Gem and replaced thejquery.treetableJS plugin with Wunderbaum, a modern vanilla JavaScript tree grid component.jQuery-related gem dependencies and related codejquery.treetableJS and CSS dependencies including cleanup on vendor/assetsjQuerycode inbehavior.jsusing vanilla JSwunderbaumJS librarybootstrap-iconsforiconMapsupport for file browse interfacevendor/assetswith files from the new libraries (wunderbaumandbootstrap-icons)node_modulestovendor/assetsfor easy management of these assetsbootstrap-iconsfonts)ActionCabledeprecation warningREADMEwith migration guide for users upgrading from oldjQueryversionNOTE:
While testing this in different browsers I was seeing some twitching with scroll behavior when auto-expanding was used to select nested folders/files. This was happening intermittently for me, i.e. sometimes scrolling works as expected without twitching.
Steps to reproduce;