[{"data":1,"prerenderedAt":276},["ShallowReactive",2],{"project-42834325":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":9,"maker":10,"posted_at":11,"year":12,"points":13,"comments":14,"rank_in_year":15,"shown_in_year":16,"top":17,"tier":18,"category":19,"subcategory":20,"format":21,"keywords":22,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":41,"post_text":42,"what":43,"said":64,"maker_in_thread":116,"shape":125,"grid":130,"attempts":235,"same_week":236,"maker_shows":266,"maker_hidden":267,"reader_version":268,"card":269},"42834325","TinyJS","TinyJs React like framework in 35 lines of code","title","Show HN: TinyJs React like framework in 35 lines of code",null,"atum47",1737926903,2025,43,40,1370,3837,36,"shown","languages","javascript ui framework","library",[23,24,25,26,27],"javascript framework","react alternative","jsx","state management","tiny framework","roasted",-0.143,{"positive":31,"neutral":32,"mixed":33,"critical":34},3,2,0,5,10,{"execution":37,"idea":38,"design":40},{"positive":33,"critical":32},{"positive":39,"critical":32},1,{"positive":33,"critical":39},[39,33,33,33,33,33,33,34,33,39,34,39,33,39,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,31,39,33,34,31,33],"Hi HN, I got to work yesterday and today and came up with a very simple way to create and manage state in TinyJS.\n\nI end up creating a simple App to illustrate how to use the new createState function and custom components in a React like manner.   Here's the code for it - https:\u002F\u002Fgithub.com\u002Fvictorqribeiro\u002Ftinyapp\n\nHere's the PR for the createState function - https:\u002F\u002Fgithub.com\u002Fvictorqribeiro\u002FTinyJS\u002Fpull\u002F9",{"problem":44,"audience":9,"pricing":9,"motivation":51,"time_to_build":55,"stack":60,"openness":61,"stage":62,"team_size":63},{"value":45,"source":46,"evidence":47},"Managing state and UI in a lightweight way without React's bloat","maker",[48],{"id":49,"by":10,"text":50},"42834566","I'm guilty of using React as framework to try to copy from. After working with it for the past 5 years I end up wanting something like it but with less bloat to use in my…",{"value":52,"source":46,"evidence":53},"Wanted something like React with less bloat for personal projects after five years using React",[54],{"id":49,"by":10,"text":50},{"value":56,"source":46,"evidence":57},"Maker says they worked on it yesterday and today",[58],{"id":59},"post",[],"open_source","prototype","solo",{"praise":65,"objections":74,"requests":89,"questions":90,"alternatives":97},[66],{"value":67,"source":68,"evidence":69},"Cool project, encouraging tinkering","commenter",[70],{"id":71,"by":72,"text":73},"42876807","campak","This is cool. Keep up the good work and enjoy tinkering!",[75,82],{"value":76,"source":68,"evidence":77},"Not really React-like; it is syntax sugar over a global state object",[78],{"id":79,"by":80,"text":81},"42834388","codingdave","So, if you are building this off 'window', you are basically just adding syntax sugar to one big global variable. That is absolutely a simple solution to storing state. In one…",{"value":83,"source":68,"evidence":84},"Does not handle structural changes like adding or removing list items, so code size is not comparable",[85],{"id":86,"by":87,"text":88},"42876902","whizzter","While I see a fair bit of elegance in your experiment, IMHO I also think that for it to be React-like and start mentioning code size one should at least handle structural changes…",[],[91],{"value":92,"source":46,"evidence":93},"Whether the state should attach methods to the state object instead of returning a proxy",[94],{"id":95,"by":10,"text":96},"42877836","``` const appState = {...state} ``` With that line I end up creating a appState inside the createState function which uses the state dictionary just as a template. Would it be…",[98,102,109],{"value":99,"source":68,"evidence":100},"React",[101],{"id":49,"by":10,"text":50},{"value":103,"source":68,"evidence":104},"Preact",[105],{"id":106,"by":107,"text":108},"42875258","MarcelOlsz","Check out \"preact\" if you haven't already [0] [0] - https:\u002F\u002Fpreactjs.com\u002F",{"value":110,"source":68,"evidence":111},"Vue-style templating and Web Components",[112],{"id":113,"by":114,"text":115},"42875189","EGreg","I never understood the fascination with JSX. Stuffing HTML into JS? You can stuff JS into HTML natively LOL. Why not use HTML templates and Web Components, or something? I would…",{"comments":34,"answered":39,"key":117},[118,121,124],{"id":119,"text":120},"42877783","> (though at larger scales it becomes more debatable) My thought exactly. In a small component as the Button I agree with inline everything (almost did it myself cause I knew…",{"id":122,"text":123},"42881992","Nice",{"id":49,"text":50},{"commenters":126,"max_depth":127,"maker_replies":34,"first_comment_mins":128,"lifespan_hours":129},23,8,7,187,[131,135,137,140,144,146,149,152,156,158,162,164,166,168,170,172,175,177,179,181,184,188,191,193,196,199,202,205,207,209,211,214,217,220,222,224,225,228,230,234],[132,33,39,133,134,33],"42875521","project\u002Fcritical\u002Fexecution","chrismorgan",[119,33,33,136,10,39],"maker\u002Fneutral\u002Fdesign",[138,33,33,139,134,33],"42884328","commenter\u002Fneutral\u002Fdesign",[141,33,33,142,143,33],"42880989","other\u002Fneutral\u002Fnone","gknoy",[145,33,33,142,134,33],"42884391",[147,33,33,142,148,33],"42887006","lrpe",[150,33,33,151,134,33],"42896214","commenter\u002Fneutral\u002Fnone",[153,39,34,154,155,33],"42881460","project\u002Fpositive\u002Fidea","bolfe11",[122,39,33,157,10,39],"commenter\u002Fpositive\u002Fnone",[159,32,39,160,161,33],"42876051","project\u002Fcritical\u002Fidea","leontrolski",[71,31,34,163,72,33],"maker\u002Fpositive\u002Fnone",[79,165,39,160,80,33],4,[49,165,33,167,10,39],"maker\u002Fneutral\u002Fidea",[113,165,39,169,114,33],"project\u002Fcritical\u002Fdesign",[171,165,33,142,107,33],"42875262",[173,165,33,151,174,33],"42875584","paulddraper",[176,165,33,151,107,33],"42879934",[178,165,33,139,114,33],"42880675",[180,165,33,139,174,33],"42883504",[182,165,33,142,183,33],"42875382","globalise83",[185,165,33,186,187,33],"42875650","other\u002Fneutral\u002Fdesign","jeswin",[189,165,33,142,190,33],"42875871","mock-possum",[192,165,33,142,187,33],"42876183",[194,165,33,186,195,33],"42876325","esperent",[197,165,33,142,198,33],"42886901","nchmy",[200,165,33,142,201,33],"42877119","gryzzly",[203,165,33,142,204,33],"42880805","WorldMaker",[206,165,33,151,201,33],"42886820",[208,165,33,151,204,33],"42888416",[210,165,33,142,198,33],"42886890",[212,165,33,142,213,33],"42875777","ajkjk",[215,165,33,142,216,33],"42875887","thomasfromcdnjs",[218,165,33,139,219,33],"42878106","mightyham",[221,165,33,186,204,33],"42880926",[106,165,31,223,107,33],"project\u002Fneutral\u002Fidea",[86,165,39,133,87,33],[226,165,33,227,10,39],"42889474","maker\u002Fneutral\u002Fnone",[229,165,34,163,87,33],"42920060",[231,165,31,232,233,33],"42876297","project\u002Fneutral\u002Fexecution","jy14898",[95,165,33,232,10,39],[],[237,242,247,252,256,261],{"id":238,"name":239,"points":240,"category":241},"42814110","Cs16.css",819,"dev_tools",{"id":243,"name":244,"points":245,"category":246},"42800893","t4t",484,"consumer_social",{"id":248,"name":249,"points":250,"category":251},"42834648","DeepSeek My User Agent",360,"ai",{"id":253,"name":254,"points":255,"category":241},"42817439","Lightpanda",319,{"id":257,"name":258,"points":259,"category":260},"42828833","Bagels",283,"productivity",{"id":262,"name":263,"points":264,"category":265},"42806616","video-starter-kit",268,"creative",53,false,"v2",{"id":270,"name":5,"line":6,"ai":267,"cat":19,"year":12,"points":13,"comments":14,"rec":28,"s":271,"top":17,"kw":272,"maker":10,"domain":273,"tier":18,"attempts":33,"strip":274,"url":-1,"mix":275,"praise":67,"objection":76,"sub":20},42834325,-0.14,[23,24,25,26,27],"","1000000501510100000000000000000000310530",[31,32,33,34],1794036668704]