TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Cell.js – A Self-constructing web app framework

70 pointsby gliechtensteinalmost 8 years ago

6 comments

dgreenspalmost 8 years ago
This is a thought-provoking new framework, thank you! It&#x27;s novel and easy to understand.<p>Having worked on sophisticated React apps, I&#x27;ve come to understand the benefits and shortcomings of its architecture.<p>One insight is that properly encapsulating UI components and their behaviors leads directly and naturally to nested state machines. React is cleanest if you have one state machine, or N independent global state machines, that drive your app. Once you start trying to compose state machines to make a sophisticated UI, you end up in setState&#x2F;callback hell, and then you try the Redux&#x2F;Elm model, in which states are composed to make bigger states. I think it&#x27;s fruitful to experiment with ways of composing state machines in which you don&#x27;t just glue the states together, but you let the machines interact. Of course you still want to keep your program easy to reason about and avoid spaghetti, but I&#x27;m sure there are interesting patterns lurking there.<p>Another issue is components in React aren&#x27;t supposed to address each other. You can easily call methods on your children using refs, though this is discouraged and interacts badly with the update cycle and higher-order components. Components not talking directly to each other is a great feature right up until it&#x27;s not, such as when you have to deal with focus and selection changes. You&#x27;re forced to contemplate taking what you thought of as pure UI state -- local to a component and tied to that component&#x27;s lifecycle -- and moving it outside of React into a store whose structure parallels the component tree (which in turn parallels the DOM), just so that you can traverse it in a reasonable fashion and update it synchronously while DOM updates remain asynchronous. In Cell.js, these three trees become one.
评论 #14533899 未加载
评论 #14532082 未加载
ezekgalmost 8 years ago
Interesting. Though not really clear why you continuously say &quot;no API!&quot; when you <i>have</i> an API--it&#x27;s just in the data itself via your &quot;special keywords&quot; i.e. $cell, $update, etc. That&#x27;s kind of like saying React components have no API since you never actually call e.g. componentDidMount directly.
teycalmost 8 years ago
Interesting, but I get worried every time I see that code refer to specific DOM id. It&#x27;s probably ok for simple programs where there is only a handful of elements. When the program gets larger, you will still need architectural pieces to coordinate data.<p>You&#x27;ve put a lot of work into this, and there are a lot of examples that are helpful to anyone who wants to evaluate it. I&#x27;m curious what is the motivation behind this design - besides zero framework ? - is this in-use in production any where?
评论 #14530236 未加载
hannofcartalmost 8 years ago
After having looked through the tutorials, I am unclear about the following:<p>1) How does one cell send messages to another. I suppose this is left to the application?<p>2) How do you test code written in Cell.js? It appears to me that this is going to be hard to do?<p>3) Is it intended that the entire webapp code be a single JS file? I guess one would need a server side build step to &quot;assemble&quot; multiple Cell.js components into a single one?
评论 #14532042 未加载
meekaakualmost 8 years ago
This is interesting. I have had a look at the examples. One question that comes to mind, how do you make a reusable component? Say I have: Part = { $cell: true, $type: &quot;h2&quot;, $text: &quot;Part No: &quot;, } Part is to be instantiated multiple times in the same page, but I want different $text. How do I pass this data?
评论 #14534603 未加载
评论 #14534700 未加载
shaknaalmost 8 years ago
JS frameworks and SEO have a rough history. Pre-rendering tends to be the workaround, but Cell&#x27;s lack of hierarchy might make that more difficult than normal.<p>How would you work around it?
评论 #14532053 未加载