Readit News logoReadit News
GenericCanadian commented on Bevy 0.18   bevy.org/news/bevy-0-18/... · Posted by u/_han
GenericCanadian · a month ago
Good learning resources for those curious:

- https://taintedcoders.com/ (I'm the author)

- https://bevy.org/learn/book/intro/

- https://www.youtube.com/@chrisbiscardi

- https://www.youtube.com/@PhaestusFox

Lots of good stuff on the official Bevy discord too

GenericCanadian commented on Bevy 0.17: ECS-driven game engine built in Rust   bevy.org/news/bevy-0-17/... · Posted by u/GenericCanadian
GenericCanadian · 4 months ago
All guides on https://taintedcoders.com/ have been updated to 0.17. Congrats to everyone on the release
GenericCanadian commented on RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components   github.com/ruby-ui/ruby_u... · Posted by u/ksec
freedomben · 10 months ago
I increasingly wonder if I'm the only one left who genuinely likes erb :-D

Not a fan of the rails erb helper methods though, so maybe it doesn't count. I almost exclusively use it outside of rails now

GenericCanadian · 10 months ago
I found using partials between projects to be a headache. I wanted a way to standardize my UI for accessibility across all projects and not have to re-implement the same standards over and over. It's nice to be able to package the UI up into a gem and keep it maintained everywhere.

It's got a nice path for incremental adoption, so there is no need to go all-in unless you want to. Personally my Rails projects are all 95%+ ruby now.

Another nice knock off effect is that the LSP and integration with my IDE (neovim) is much nicer with Phlex components than it is with ERB.

I also think personally I don't like "magic" spaces like ERB where its hard for me to follow the code path. How does ERB manage multiline blocks with html in them? Hard to understand, harder to explain. To me it feels like there is less to worry about in Phlex where I'm thinking more in Ruby, less in the specifics of the view context.

GenericCanadian commented on RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components   github.com/ruby-ui/ruby_u... · Posted by u/ksec
jherdman · 10 months ago
Have you had much luck with slots? I have a project using View Components that leverages slots. I've tried migrating to Phlex, but the lack of explicit slot support has been a bit frustrating.
GenericCanadian · 10 months ago
Slots are pretty easy in Phlex. Have a look at the README in the repo I linked for an idea. I just create `with_column` or `with_header` methods that take a block and store it.

To create them declaratively (not needing to call them in a set order) you just create a module that defines `before_template` and calls `vanish`: https://www.phlex.fun/miscellaneous/v2-upgrade.html#removed-...

GenericCanadian commented on RubyUI (Former PhlexUI): Ruby Gem for RubyUI Components   github.com/ruby-ui/ruby_u... · Posted by u/ksec
GenericCanadian · 10 months ago
Phlex is an amazing project. Makes frontend fun again. I've built my own UI library using DaisyUI and Tailwindcss that we use in all our Rails projects: https://github.com/inhouse-work/protos

It cannot be overstated how nice it is to move away from erb and into pure ruby. Private methods as partials is a game changer for refactoring your UI.

GenericCanadian commented on Ruby “Thread Contention” Is Simply GVL Queuing   island94.org/2025/01/ruby... · Posted by u/ciconia
kace91 · a year ago
I keep hearing about the dev satisfaction with ruby, but I'm starting to work with it and I haven't yet felt it at all - I see many footgun design decisions like clashing classes not being an error, and blocks feel like a more cumbersome/limited version of lambdas/first class functions.

I'm not saying this to attack the language, just pointing my current mental picture to ask: what's the magic everybody loves? I know there is something there because it's an almost unanimous view among ruby devs, so I want to get it.

GenericCanadian · a year ago
As someone who's worked with Ruby for 12 years here are some insights:

Ruby makes message passing first class. That just changes how you think about programs. In exchange you give up passing functions so our anonymous functions are our blocks (actually just another object that can receive messages). So you don't `list(something)` you `something.list` and that lets you change what `.list` does depending on who `something` is very easily.

Ruby's defining feature is that the line between language author and program author is razer thin. You can completely change the language yourself by extending core classes. This is why we have `1.day` in Rails even though its not supported in the main language. DHH (author of Rails) could add that without consulting Matz (author of Ruby). So lots of stuff gets prioritized to make developers happy because its easy to add.

In Ruby the messages you receive are passed up the chain of ancestors. Your ancestors are a linked list of classes going back to a root class like `Object`. You can modify this linked list at will with mixins and inheritance with complete control (should I go before or after this other receiver).

Ruby's REPL and debugging experience is amazing. I often keep one tab with an `irb` or `rails console` open to sketch things while developing the code for it elsewhere. I'm also always inside a debugger to figure things out. When I'm in Rust or Python I'm met with a very different environment.

GenericCanadian commented on Ruby 3.4.0   ruby-lang.org/en/news/202... · Posted by u/aaronbrethorst
replwoacause · a year ago
If I want to make a SSR site using Ruby, are there any good frontend UI libraries that make doing this easier? It’d be nice if there was some Ruby abstraction for writing HTML, CSS, and JS that makes building interactive UIs easier (possibly built on top of HTMX, AlpineJS, etc).
GenericCanadian · a year ago
I would suggest taking a look at Phlex (https://www.phlex.fun/). This kind of ruby maximalism is very pleasing to the dev process. For the interaction I'm using hotwire and stimulus. Been using pure Phlex views in production for 2 years now. I wrote Protos (https://github.com/inhouse-work/protos) which is built on top of Phlex and adds a bunch of quality of life features I wanted.

u/GenericCanadian

KarmaCake day263July 7, 2022View Original