Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
joeldrapper
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
joeldrapper
2y ago
There is an experimental feature that allows you to use ERB templates like ViewComponent. https://github.com/phlex-ruby/phlex/pull/867
32.
▲
by
joeldrapper
2y ago
It’s because that’s how constants are named in Ruby. The method names match the constant names of the component classes.
33.
▲
by
joeldrapper
2y ago
This is nonsense. You can cache it like anything else. But you probably won’t need to because it’s so fast.
34.
▲
by
joeldrapper
2y ago
In my experience, it’s not an extreme scenario to render several thousand components in a single view. I think you’re looking at this from the perspective of having maybe a partial for your header and another for your footer. The way you bu
35.
▲
by
joeldrapper
2y ago
I believe Clearscope is the largest app using Phlex views exclusively, with 454 components and counting. There’s a list of some other users here. https://www.phlex.fun/project/community.html#who-s-using-phl...
36.
▲
by
joeldrapper
2y ago
It probably is (or at least was) faster than ActionView if you use lots of small partials, but it is not faster than ERB since it is not compiled. It generates HTML at about 1.6gbps per core on my laptop so probably fast enough for most thi
37.
▲
by
joeldrapper
2y ago
They’re not in the root namespace. They are instance methods (on the instance of the component) that start with a capital letter. https://www.phlex.fun/components/kits.html
38.
▲
by
joeldrapper
2y ago
How do you write an each loop or a conditional in HTML?
39.
▲
by
joeldrapper
2y ago
Vue3 is great. Also Svelte5. But I’m not sure I would use either of those for an email. And sometimes you don’t need any interactivity in the frontend and server-side-rendered HTML can be a good option.
40.
▲
by
joeldrapper
2y ago
> another layer of abstraction that new hires need to understand. Another DSL to learn. The thing about Phlex is it’s actually one less thing to learn. Instead of learning Ruby and ERB and how to use them both with HTML — and all t
41.
▲
by
joeldrapper
2y ago
> I'm not sold on some of its design like the distinction between views and components There is no distinction in Phlex. The distinction is only made in generated code in Phlex-Rails where it felt like a sensible way to fit with the
42.
▲
Zed Launches Edit Prediction with new Zeta LLM
(zed.dev)
21 points
by
joeldrapper
2y ago
|
2 comments
43.
▲
by
joeldrapper
4y ago
Ruby has blocks, so in Phlex, you’d write it like this using methods and keyword arguments. div(class: "example") do h1(id: "heading") { "This is an example" } h2 { "creating React markup"
44.
▲
by
joeldrapper
4y ago
You can avoid transpiling if you write views in pure Ruby instead. Ruby syntax has everything you need to concisely represent all valid HTML — method calls are tags, keyword arguments are attributes and blocks are content.
45.
▲
by
joeldrapper
8y ago
I count at least 17,800 requests for this feature. https://www.google.com/search?q=%22WIP%22+inurl%3Apull+site%...