TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: LiveViewJS – TypeScript back end for LiveView Apps (Phoenix LiveView)

146 点作者 floodfx超过 3 年前
Author here. I really love the programming paradigm behind by Phoenix LiveView applications and wanted to expand the ecosystem to include programmers like myself that love Typescript.<p>In summary, LiveViewJS reuses all the Phoenix client code and implemented a new backend in Typescript to handle client events and send back updates. Lots more detail and examples in the repo.<p>Would love any questions and&#x2F;or feedback. Thanks!

13 条评论

sph超过 3 年前
Javascript is like Ice 9, it turns everything it touches into Ice 9.<p>LiveView was invented not to have to deal with Javascript-powered SPA architectures and client-side coding in general, because JS is ass, and here&#x27;s LiveViewJS to convert to Javascript a technology invented not to deal with Javascript.<p>Gary Bernhardt warned us, yet no one listened. <i>shakes fist at cloud</i><p><a href="https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;the-birth-and-death-of-javascript" rel="nofollow">https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;the-birth-and-death...</a>
评论 #30307535 未加载
评论 #30309413 未加载
评论 #30308966 未加载
评论 #30307617 未加载
searchableguy超过 3 年前
How is the performance and scaling story compared to live view?<p>Live view works so well because of elixir and BEAM. The same model may not translate well to other languages depending on their concurrency and recovery pattern. There are also many optimizations in BEAM for keeping latency consistent over throughout alone which is important for live view applications.<p>I also wonder if it will be possible to have push only live view application. One of the reasons for this is you can use server events instead of sockets. It would be cool for building visualization or showing metrics from backend.<p>Awesome job all around. I love the examples folder.
评论 #30305383 未加载
lucis超过 3 年前
I appreciate projects like this, as LiveView brings some amazing solutions to the game, but I&#x27;d guess that even if it was &quot;feature-complete&quot;, I would still miss the so many great stuff about the BEAM&#x2F;Elixir.<p>Although, the safety of Typescript is the only thing that stops me from building my next hobbie&#x2F;side-project with Elixir. After you get the benefits from the type system (specially in the TS ecosystem), it&#x27;s hard to go back.<p>Looking forward to see where the project goes!
评论 #30308070 未加载
darnfish超过 3 年前
Reminds me a little of <a href="https:&#x2F;&#x2F;github.com&#x2F;calderajs&#x2F;caldera-react" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;calderajs&#x2F;caldera-react</a>
评论 #30305116 未加载
评论 #30309354 未加载
tbranyen超过 3 年前
Hi floodfx, we should chat at some point if you&#x27;re on slack&#x2F;discord&#x2F;etc. I&#x27;m building something extremely similar and there&#x27;s potential opportunity to share some code&#x2F;learnings. Personally I feel this design paradigm is the real web 3.0.<p>My project is <a href="https:&#x2F;&#x2F;diffhtml.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;diffhtml.org&#x2F;</a> and I have started experimenting with middleware to bridge to server and client workers: <a href="https:&#x2F;&#x2F;github.com&#x2F;tbranyen&#x2F;diffhtml&#x2F;pull&#x2F;251" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tbranyen&#x2F;diffhtml&#x2F;pull&#x2F;251</a>. For the server worker, it uses a WebSocket to ferry the VDOM diff patches, custom events, and property access&#x2F;function calls. A big goal is to allow synchronous &quot;main thread&quot; access from workers, including on the server-side. This would allow you to write your UI code as if you were a client side app. It does this the same way as partytown using a SharedArrayBuffer and Atomics. You can see demo source code here: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;tbranyen&#x2F;2f5be81cfb7b3aa1bb443c8ef13f43a4" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;tbranyen&#x2F;2f5be81cfb7b3aa1bb443c8ef13...</a>.<p>I&#x27;ve also toyed around with hot reloading components without the need for a pre-processor like Babel, and the results are hugely promising. Stateful live UI updates from saving a component file to seeing in the browser without all the fuss with complex build steps is liberating.<p>I&#x27;m probably a few months out from having a usable beta, but I&#x27;m going to follow your project closely. Thanks for sharing!
评论 #30306243 未加载
评论 #30306408 未加载
pawelduda超过 3 年前
I think the main reason original LiveView is so great is that it fits really well into the Erlang&#x2F;Elixir&#x2F;Phoenix ecosystem. Love to see the idea spreading though!
评论 #30306324 未加载
flessner超过 3 年前
I tried Phoenix LiveView recently and it feels really refreshing. In comparison to Svelte (my preferred tool usually) it feels oddly similar like it occupies the same idea with a completely different execution.<p>I personally prefer JS over Elixir and having everything in one language also makes everything easier... maybe there is also a future to fuse some of these concepts into Svelte (I will have to experiment :D )
评论 #30307755 未加载
评论 #30307679 未加载
aloukissas超过 3 年前
Elixir and TS fan here: curious, what would be the use for this, aside of what looks like a very interesting project? The main strength of LV is that is sits on top of the BEAM and OTP which makes it very suitable to scale predictably. Other frameworks have tried to do that (Hotwire or something for Rails iirc), but they lack the benefits of the BEAM. Epic job though!
评论 #30312919 未加载
interactivecode超过 3 年前
I always thought the react programming model could solve most criticisms perfectly with a built in liveview style server part
prophesi超过 3 年前
This is really cool! So basically instead of using LiveEEX templates, you can write it like a SPA with Typescript?
评论 #30304930 未加载
xtlc超过 3 年前
There is htmx: www.htmx.org. maybe also a good source for ideas.
hartator超过 3 年前
Any live demos to play with? Good work.
评论 #30304976 未加载
benburton超过 3 年前
Looked interesting. Thought I would take a deep dive. README references a video behind a subscription paywall? I&#x27;m out.
评论 #30308618 未加载