MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.68k stars 400 forks source link

Refactor parameter query settings into its own class #592

Open technicalpickles opened 8 months ago

technicalpickles commented 8 months ago

@nateberkopec mentioned in passing how big the call method is. This is just my attempt to reduce it a little 😁

technicalpickles commented 8 months ago

This PR kinda got away from me 😁 It ended up being more about abstracting what settings are being passed in via query parameters than the skip logic.

I made a QuerySettings which encapsulates the logic. I think this has nice parity with ClientSettings, because we have places that end up like query_settings.something || query_settings.something which feels nice.

As I was going through this, I saw that there are a bunch of places doing =~ to check matches, but not using the results. I changed those to match? to avoid allocating match data.

technicalpickles commented 7 months ago

Have some merge conflicts to sort out in the wake of https://github.com/MiniProfiler/rack-mini-profiler/pull/593

SamSaffron commented 4 months ago

I like this change a lot but yeah we need a rebase here.