5 ms·
> Easy to learn: There is NO API to learn. True, but how useful is it? > Easy to reuse: Everything is powered by stateless functions instead of classes and ob
by namuol 9y ago
> Easy to learn: There is NO API to learn.
True, but how useful is it?
> Easy to reuse: Everything is powered by stateless functions instead of classes and objects, making it extremely modular.
Maybe it's all stateless functions under the hood, but the "hello world" code snippet includes code that mutates the DOM:
onkeyup: function(e){
if(e.keyCode === 13){
document.querySelector("#list")._add(this.value);
this.value = "";
}
}
> Easy to maintain: "Development workflow" doesn't exist. No NPM, No Webpack, No Babel, just vanilla Javascript and 100% based on web standards.
Are these tools really the main source maintenance pain for web developers?
In my experience the code I write is the biggest maintenance burden. I'll suffer through complex tooling if it helps me avoid maintenance anti-patterns (like storing state on DOM elements...)
- gliechtenstein 9y agoHi, author here. Most of the work cell does internally is to let users interact with the dom as though they are touching them directly, but at the same time actually insulates them from doing so by using a pseudo proxy object. please feel free to take a look at the source. The "Nucleus" is the part that handles all this. Hope this answers your question!
- namuol 9y agoThe problem with the mutations isn't the direct DOM access; it's that mutation is an unscalable approach to representing UI. A lot more needs to be "kept track of".
- Pitarou 9y agoI don’t know why they call it “stateless” either. It clearly isn’t. Are they confused about what the word means?
- guscost 9y agoHere's how I understood it... The DOM elements aren't stateless, but they will behave like they are if you update every attribute that can change in the `$update` function. Really all you're doing is mutating the DOM objects themselves, but one of them is this magic `$update` function that runs every time one of that element's attributes changes I think. The framework just provides a proxy object for accessing the attributes, and every cell is extensible with custom data and functions. For some fun try overwriting `this.$update` in `$update`. Another thing I totally missed at first is the fact that you can embed a <script> containing a variable with the `$cell` property anywhere in the page and the cell will show up in that part of the DOM, and you can do this as much as you want.
- guscost 9y agoActually, there's a better method for embedding in an element: Just put the <script> wherever you want, but include an `id` in the configuration object that matches a <div> in your page.
- SomeCallMeTim 9y ago> Are these tools really the main source maintenance pain for web developers? I consider TypeScript (or Elm) support a best practice for "JavaScript" development, so something that brags about not having a development workflow is a non-starter. It's not only not a pain for me, it's a significant missing feature.
- the_duke 9y agoDepends on what you are writing. If it's something that has to be maintained for more than a month, use Typescript or Flow. Just do it. Everything else is a PITA. If it's just something you want to whip up quickly and won't be maintained, jumping through all the hoops of npm, building and bundling is just annoying.