https://owaiskhan.me/post/formatting-and-linting-erb-files-with-zed
| Blog | https://owaiskhan.me/blog |
| GitHub | https://github.com/owaiswiz |
| https://twitter.com/owaiswiz |
LiveView’s unique integration between server and client allows it to drastically optimize both latency and bandwidth, leading to user experiences that are faster and smoother than any other client-server combo out there
I wrote a blog post recently about speeding up code reloading in Rails for a faster feedback loop while developing.
https://owaiskhan.me/post/improving-performance-in-development-on-a-big-rails-app
Might be a significant enough improvement if you've got a huge Rails app with lots of routes and making a request after doing a code change locally is very slow for you.
Slow requests in development are painful. They lead to slower feedback loops and decrease productivity. If you are working on a big Rails app, and you're encountering slow requests, especially after you make a change, there might be a simple way to make things fast
If you use VSCode and have a lot of View Components, configuring explorer.fileNesting might clean up your `app/components` in the explorer a lot:
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*_component.rb": "_${capture}_component_*.html.erb, ${capture}_component.html.erb, ${capture}_component.js, ${capture}_component_controller.js, ${capture}_component.scss"
},
I've always felt rendering ViewComponent with Rails is a bit too verbose.
Especially if you have namespaces. E.g:
render(Admin::Navigation::Item.new(label: 'Example'))
I've used a helper to make it nicer on 2 projects so far:
vc.admin.navigation.item(label: 'Example')
Maybe make it into a gem?
(Might seem a bit over-engineered on a first glance. But it's something that might be called 100s-1000s of time on a page, so had to make sure it's fast enough.