HackerTrans
TopNewTrendsCommentsPastAskShowJobs

richeyryan

no profile record

comments

richeyryan
·2 jaar geleden·discuss
It seems like the move is to force ByteDance to set up a company incorporated wholly in the United States, which would then be subject to the oversight of the US government. Then, Byte Dance would lease the IP surrounding TikTok to this separate company. All the US customer data would be siloed on US servers and perused by US agencies and Byte Dance would still get their revenue from the US market. I don't know if the close association with ByteDance and China would still make that sort of arrangement a target of the US government.
richeyryan
·2 jaar geleden·discuss
I suspect they want better condition handling. Because JavaScript lacks a useful conditional expression beyond ternary expressions, condition handling in JSX generally uses boolean operators or ternary expressions. Suppose the conditional logic is in any way complex. In that case, your choice is to use nested ternary expressions, which can be hard to read or to somehow break the condition out of the JSX using a helper function or separate component so you can use if statements in a regular function context. SolidJS added conditional helpers to its JSX flavour to address this issue[1]. The React team seems ideologically opposed to the idea as it presumably moves JSX away from using only JavaScript for handling logic.

[1]https://www.solidjs.com/docs/latest/api#show
richeyryan
·2 jaar geleden·discuss
Most computer users don't use command-line apps day in and day out. Most computer users nowadays use chat apps (Discord, Slack, Whatsapp) and have probably encountered bots on those platforms before. There is an inherent familiarity that makes it feel more accessible.
richeyryan
·2 jaar geleden·discuss
Substitute software for standard accountancy practices or a filing system that led to lost files, giving the incorrect impression that postmasters were stealing, and the result would have been the same. The core issue is an organisiation that values avoiding blame at all costs over transparency and accountability.
richeyryan
·3 jaar geleden·discuss
It would be nice if the author would add mozjpeg[1] to the comparison. At certain image resolutions, it can produce smaller file sizes than WebP, and because it is still a jpeg, it has a much better compatibility story, which the author alluded to.

[1]https://github.com/mozilla/mozjpeg
richeyryan
·3 jaar geleden·discuss
I think the use of template strings simplifies it, even inline:

const { status } = await send(`${capitalize(greeting)}!`)

console.log(status)

It does reduce the number of discrete operations to make the pipe example look more impressive, though.
richeyryan
·3 jaar geleden·discuss
Perhaps this falls into the repetitive boilerplate category you referred to, but if you want framework-agnostic domain objects that still work well with Svelte, create your own using the observer pattern.

Create an object with a subscribe method and whatever other methods make sense for updating its state. Svelte will treat it like one of its stores, and it will work with the $ syntax. It can be used with React via its `useSyncExternalStore` hook. It can be used with SolidJS via its `from` utility.

If you don't want to handle the set-up boilerplate, you could use another library like Effector or RxJS, but of course, that means another dependency. There is a gradual move to make something like this a part of the platform[1], but who knows when or if it will land.

[1] https://github.com/domfarolino/observable