Re:Show HN: Nue – Apps lighter than a React button
by troupo on Tuesday April 01, 2025 @08:41AM
(#43546086)
Nothing in your view is "web standards". And nothing in web standards can do the heavy lifting of showing things like "`nam` is not defined on object `user`"
[ Parent
| on HN ]
Re:Show HN: Nue – Apps lighter than a React button
by joquarky on Wednesday April 02, 2025 @03:31PM
(#43560586)
if (!user || typeof user.nam !== 'string') {
throw new Error("Missing or invalid 'nam' on user");
}
Contemporary JavaScript has optional chaining, default values, and reflective tools like Object.hasOwn, which are all web standards. You just have to know how to use them.
Re:Show HN: Nue – Apps lighter than a React button
by troupo on Thursday April 03, 2025 @05:16AM
(#43567012)
You really don't understand what types give you, do you?
Where are you going to put the code above in this:
<section @name="user-details" class="user">
<media :image="/app/icon/cc/{cc}.svg" :title="name">
<p>{ email }</p>
</media>
<dl :if="org">
<dt>Company</dt> <dd>{ org }</dd>
<dt>Country</dt> <dd> { country }</dd>
<dt>Company size</dt> <dd>{ size.desc } ({ size.label })</dd>
<dt>Website</dt> <dd><a class="action">{ website }</a></dd>
<dt>Plan</dt> <dd><pill icon="dot" :label="{ plan }"/></dd>
</dl>
<media-thumbs :items="shots"/>
<chat-thread :thread="thread"/>
</section>Are you going to write ifs for every permutation of possible typos? (Let's ignore for a second that it's not just typos)