News for hackers. Stuff that matters.
Re:RoR Debugbar by MarceColl on Sunday February 18, 2024 @01:04PM (#39421358)
How would you be able to implement this functionality only from the frontend without ever adding backend code? You'll always need to expose this info from the backend somehow. Of course with react and vue the data is available since it's already in the frontend.
Re:RoR Debugbar by julienbourdeau on Sunday February 18, 2024 @01:22PM (#39421543)
Yeah you always need a backend part as part of your dev dependencies but currently you also need to add a little snippet in your production view code.

It could be a browser extension like Rails panel + meta_request but I think it’s also good that anybody working on the codebase always get the debugbar, regardless of their browser or setup.

Re:RoR Debugbar by pmontra on Sunday February 18, 2024 @02:37PM (#39422318)
The downside is that if the project decides not to have that in the code, nobody gets it. Example: I suggest to a customer to use it. They decide they don't want it, I can't use it too.
Re:RoR Debugbar by loktarogar on Sunday February 18, 2024 @03:55PM (#39423227)
Without some kind of perf api baked into rails, this will require some server side code at the very least. An extension won't work without _something_ on the server.

But, there's also nothing stopping you from adding this during development and not committing it.

Re:RoR Debugbar by samtheprogram on Sunday February 18, 2024 @03:01PM (#39422542)
There’s no reason you couldn’t just leave it in your own branch of git and not merge it. It’s not that hard.
Re:RoR Debugbar by julienbourdeau on Sunday February 18, 2024 @03:46PM (#39423117)
That’s a good point, I didn’t consider it this way.
Re:RoR Debugbar by ckolkey on Sunday February 18, 2024 @04:36PM (#39423639)
One thing to check out: ruby-lsp gets around this by using a custom gemfile, which enhances the project with the lsp's dependencies. That means you can use the gem, with bundler, without adding anything to the "official" project gemfile.

You could probably accomplish something similar, and possibly inject some rack middleware to add the view, or even mount it as a rails engine.

Re:RoR Debugbar by pmontra on Monday February 19, 2024 @02:23AM (#39427004)
Some details from https://github.com/Shopify/ruby-lsp

> NOTE: starting with v0.7.0, it is no longer recommended to add the ruby-lsp to the bundle. The gem will generate a custom bundle in .ruby-lsp/Gemfile which is used to identify the versions of dependencies that should be used for the application (e.g.: the correct RuboCop version).

Re:RoR Debugbar by sb8244 on Sunday February 18, 2024 @06:58PM (#39424814)
Couldn't you only have the snippet in the layout in dev environment? That's fairly common