Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
chrismccord
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
chrismccord
5y ago
I remember when Sencha came on the scene :) WebSocket's help for more efficient bidirectional comms and guarantee load-balanced process placement, but LiveView can also be used with long polling if folks have a hard requirement. We als
62.
▲
by
chrismccord
5y ago
In an abstract sense, yes, but we don't actually keep a vdom in Phoenix LiveView. You might want to reconsider this hot take. We actually send less data on the wire than the best hand-written JSON payload you could come up with in many
63.
▲
by
chrismccord
5y ago
Good suggestions. There is indeed a bug on chrome when clicking on the file link vs drag and drop. Something about dispatchEvent("click") vs .click(). Will fix in a bit!
64.
▲
by
chrismccord
5y ago
LiveBeats is hotlinking https://fly.io/ui/images/<region>.svg and Kurt updated a few of the US region images to be more specific vs blanket flag. The browser on the right is chrome, with the cached old image
65.
▲
by
chrismccord
5y ago
Livebook, which is an elixir code notebook built with LiveView includes collaborative editing with presence, so it absolutely can be used in that domain. LiveView is built on phoenix channels, so it's all bidirectional communication. T
66.
▲
by
chrismccord
5y ago
Phoenix / LiveBeats author here – happy to answer any questions about Phoenix, LiveBeats, or Fly.io. We had a ton of fun building this. It's way more fun to see where folks are connecting to and what kind of pings they get than I
67.
▲
by
chrismccord
5y ago
In this case, the rule is for all interactive elements. It's not just buttons, but anchor tags as well (or any other element a user decides to put a `phx-click` and friends on. Phoenix LiveView internally already noops if it's n
68.
▲
by
chrismccord
5y ago
1. Fantastic for non-browser clients. The community has native channel clients for objc/swift/c++/rust/java so you can do real-time things natively, and course do standard json/graphql. 2. Yes, we scale vertically a
69.
▲
by
chrismccord
5y ago
There has been a large number of LiveView-like solutions pop up that are inspired by what we're doing. I tried to outline what makes Elixir uniquely suited to handle this kind of thing in the post, but I'll try to distill it here:
70.
▲
by
chrismccord
5y ago
It's absolutely possible, but you are right our docs and guides are more tailored to folks already familiar with web development. I would love to see more Elixir and Phoenix content for someone who has never written a program before. I
71.
▲
by
chrismccord
5y ago
> Not a good fit is rather charitable. s/obviously not a good fit/non-starter :) > I think that 'read-only mode' and 'can't interact at all' mode are not the same. I agree, but it depends on the appl
72.
▲
by
chrismccord
5y ago
Phoenix Channels (which LiveView is built on) is transport agnostic, so as soon as we can open a pipe from the browser's JS environment, and listen on the server, we could have a `Phoenix.Transports.WebTransport`. All the existing user
73.
▲
by
chrismccord
5y ago
We have optimistic UI features where we'll apply a css class to the interacted element, lock that DOM container for inbound updates, and only remove the class when that specific interaction is acknowledged by the server. We can also sw
74.
▲
by
chrismccord
5y ago
Hot upgrades are a powerful and essential feature – when you have hard requirements for it. As you said, hot upgrades aren't simple and introduce a lot of work to get right. I like to tell folks, imagine you are building a pusher.com c
75.
▲
by
chrismccord
5y ago
1. Thanks! You are right Phoenix also great for APIs, and this story is pretty much baked as far as Phoenix specific features go. There's absolutely a place for SPAs, and the JavaScript ecosystem has number of great options. Anything r
76.
▲
by
chrismccord
5y ago
For things requiring the server to be there anyway – the exact same way an SPA would work, but a little faster round trip. For things that should happen instantly on the client, you'd run some JavaScript on the client via a pcx-hook (J
77.
▲
by
chrismccord
5y ago
It's unfortunate there's no standard way to dispatch this kind of thing ARIA wise. Fortunately live navigation is opt-in, so folks can continue to use `<%= link "page", to: ... %>` vs `<%= live_redirect "pa
78.
▲
by
chrismccord
5y ago
No blockers. We're simply giving folks time to try things out and report issues. No show stoppers at the moment so I imagine final release won't be far off!
79.
▲
by
chrismccord
5y ago
If you think the docs can be improved, please let us know. You can also find us on elixir-slack or elixirforum.com to ask for help. This should get you started: //<input type="text" name="body" phx-ho
80.
▲
by
chrismccord
5y ago
The 60fps rainbow works as a fun stress test demo, but really you should not be pushing events down the wire every 16ms to animate something on the client :) That said, you are right that SVG charts/maps are a surprisingly fantastic
81.
▲
by
chrismccord
5y ago
LiveView will automatically recover the connection, but you are correct it requires a connection to allow interactivity, but this isn't different from being unable to post a tweet while driving under the subway. The interesting thing a
82.
▲
by
chrismccord
5y ago
You'd use the optimistic UI features that LiveView ships with out of the box to handle the arrow click, and you wouldn't await a server round-trip for each keypress, so again that's now how LiveView form input works. For post
83.
▲
by
chrismccord
5y ago
> It’s telling that every answer is “just deploy servers near your users.” This isn't the takeaway at all. The takeaway is we can match or beat SPAs that necessarily have to talk to the server anyway, which covers a massive class of
84.
▲
by
chrismccord
5y ago
These kinds of discussions miss a ton of nuance unfortunately (as most tech discussions do), so hopefully I can help answer this broadly: First off, it's important to call out how LiveView's docs recommend folks keep interactions
85.
▲
by
chrismccord
5y ago
Phoenix channels is similar to socket.io, except we multiplex the channels with their own events, vs socket io that creates a single bidirectional "channel" with events. So you can think of channels as namespaced socket.io, with t
86.
▲
by
chrismccord
5y ago
We structure Elixir applications differently than a lot of platforms. Phoenix is not your app – it's just one thing that slots into your Elixir application's supervision tree. So you can run one Phoenix web server or multiple in a
87.
▲
by
chrismccord
5y ago
My pleasure! LiveView is built on Phoenix channels, so it has the same scaling characteristics of a channels application. We had 2 million connections, but what that means is those 2 million websocket connections each started a channel to j
88.
▲
by
chrismccord
5y ago
Phoenix is still fantastic for JSON and GraphQL apis. In fact, with GraphQL subscriptions, it's extremely well suited because how well we handle WebSockets and pubsub. The community has a robust GraphQL toolkit which works with Phoenix
89.
▲
by
chrismccord
5y ago
The Phoenix 1.6 release candidate has been out for a few weeks, and we now include a `phx.gen.auth` generator for a fully bootstrapped authentication solution: https://hexdocs.pm/phoenix/1.6.0-rc.1/mix_phx_gen_auth
90.
▲
by
chrismccord
5y ago
Creator of Phoenix here. I'm happy to answer any questions folks have about LiveView, Phoenix, or Elixir in general. We've had some big LiveView features land recently with uploads and HEEx so now's a great time to jump in!
More ›