3 ms·
Could you share this? I'm a backend developer and I just want to make light frontends with flexbox, grid and javascript. But it'd be nice to scale to more compl
by nsomaru 7y ago
Could you share this? I'm a backend developer and I just want to make light frontends with flexbox, grid and javascript. But it'd be nice to scale to more complex UIs also with a few functions.
- uk_programmer 7y agoUnfortunately not. However I can give you some pointers. I've basically have an implementation of Observer Pattern, PubSub and I have written something similar to hyperscript. https://github.com/hyperhype/hyperscript https://github.com/hyperhype/hyperscript https://webdevstudios.com/2019/02/19/observable-pattern-in-javascript/ https://webdevstudios.com/2019/02/19/observable-pattern-in-j... https://codesandbox.io/s/vqq4vvxl20?view=preview https://codesandbox.io/s/vqq4vvxl20?view=preview
- adrianhel 7y agoJust use vanilla JS to begin with. If your app has a lot of interaction, you can use React with create-react-app makes things easier. You can still use vanilla JS, HTML and CSS. And it's not morally wrong. Assess the requirements. Lots of moving parts and not a whole lot of time? React or Vue lets you draw the big lines quite simply. Need something simple or with fancy animations? Vanilla may be your best bet. Personally I use vanilla for simpler stuff and React for more complex apps. Don't worry, just make cool stuff. Nobody ever cares how you built it, just that it works. Trello still uses CoffeeScript. It really does not matter as long as it works. PS: You can combine if and when needed.
- DEADB17 7y agoMost of the complexity comes from state management and tracking data dependencies, not dom manipulation. If you like keeping things light this library gives you a lot of bang for the buck: https://github.com/MaiaVictor/PureState https://github.com/MaiaVictor/PureState It's similar to how pub/sub works but it does the topological sort that prevents data with diamond shaped dependencies from being triggered twice, in less than 500bytes minified (before zipping).