Skip to main content

Show HN: Thi.ng/hdom: S-expression based, pure ES6 UI/VDOM components https://ift.tt/2OKIU7A

Show HN: Thi.ng/hdom: S-expression based, pure ES6 UI/VDOM components http://thi.ng/hdom Lightweight UI component tree definition syntax, DOM creation and differential updates using only vanilla JS data structures (arrays, iterators, closures, attribute objects or objects with life cycle functions, closures). By default targets the browser's native DOM, but supports other arbitrary target implementations in a branch-local manner, e.g. to define scene graphs for a canvas element as part of the normal UI tree. Benefits: - Use the full expressiveness of ES6 / TypeScript to define user interfaces - No enforced opinion about state handling, very flexible - Clean, functional component composition & reuse - No source pre-processing, transpiling or string interpolation - Less verbose than HTML / JSX, resulting in smaller file sizes - Supports arbitrary elements (incl. SVG), attributes and events in uniform, S-expression based syntax - Supports branch-local custom update behaviors & arbitrary (e.g. non-DOM) target data structures to which tree diffs are applied to - Suitable for server-side rendering and then "hydrating" listeners and components with life cycle methods on the client side - Can use JSON for static components (or component templates) - Optional user context injection (an arbitrary object/value passed to all component functions embedded in the tree) - Default implementation supports CSS conversion from JS objects for style attribs - Auto-expansion of embedded values / types which implement the IToHiccup or IDeref interfaces (e.g. atoms, cursors, derived views, streams etc.) - Only ~5.5KB gzipped September 23, 2018 at 03:42AM

Comments

Popular posts from this blog

Launch HN: Simmer (YC W19) – Reviews for Delivery Dishes https://ift.tt/2Y4sD67

Launch HN: Simmer (YC W19) – Reviews for Delivery Dishes Hi HackerNews community! We’re Vaibhav and Richard, founders of Simmer ( https://usesimmer.com ). Simmer aggregates dishes from DoorDash, Caviar, GrubHub, and basically every other delivery platform out there, and tells users the best dishes across the board. We do this by providing dish-level reviews. Users find highly reviewed dishes on Simmer, choose the delivery platform of their liking, and we deep link them into their chosen delivery app. We essentially lead gen to delivery. We started working on Simmer because we loved trying new restaurants, but never knew what to order. Especially, when there’s a 5 page menu. We always asked ourselves, “Why aren’t there ratings for individual dishes?” We launched our app with this restaurant-centric use case (reviews for every dish at every restaurant), but when we rolled out delivery integrations, we realized that users resonated most with the delivery angle. They found it particularly ...