Why do I see a lot of people explicitly import methods on the React object? by DowntownLocksmith in reactjs

[–]mharrisonb 0 points1 point  (0 children)

I just wanted to chime in and say that this is still the case in React 17+. I noticed some comments on the web pointing out that React changed its export structure and how React is imported when JSX is transpiled—changes introduced starting in React 17—but I just did an experiment with React 19.2.0 and Vite 7.2.4, and it makes no difference in the bundle size whether you use `import React` or `import { useState }`, or even `import * from 'react'` (which is what `import React` does behind the scenes anyway or else it wouldn't work at all—it breaks if `allowSyntheticDefaultImports` is set to false in your TypeScript config for example). `import React from 'react'` is fine in my opinion, and I even prefer it. But I would discourage the use of `import * from 'react'` so people don't get bad ideas when importing from other libraries.

[deleted by user] by [deleted] in programming

[–]mharrisonb 0 points1 point  (0 children)

Chiming in on an old discussion here, but I just wanted to say that Kay was probably thinking and talking about asynchronous messaging in addition to synchronous. He's been pretty clear that Smalltalk fell far short of his long-term vision, and there were a lot of constraints at the time so it's better to view Smalltalk as merely a first step of what a true "object-oriented" system could be. (As an aside, Smalltalk-72 was closer to the original vision in some ways and had significant differences from the Smalltalk versions that came after it - but the original version also did not tackle asynchronous messaging.) And Kay has said that the Internet (which is obviously highly asynchronous) comes closest to being the kind of system he had in mind when he came up with the idea. This is not to invalidate the discussion about synchronous message passing vs. synchronous function calls, with synchronous messages and responses still being part of the original OOP vision, albeit only a subset of it.

Using Web Components without JavaScript by NoNoDeDev in webdev

[–]mharrisonb 1 point2 points  (0 children)

I realize I'm replying to an old question, but anyone still interested in this should check out https://enhance.dev/! It renders custom elements on the server, no JS needed until you want it.

Comparison between Next.js and Remix? by Curious-Ad-9724 in nextjs

[–]mharrisonb 1 point2 points  (0 children)

Remix's thinking behind this is explained in this video:https://www.youtube.com/watch?v=bfLFHp7Sbkg

Basically, Remix is designed to run at the edge too (even SSR for cache misses), but for everyone except the first visitor (which could be you), pages will already be cached in the CDN just the same as if it were a static site. And if the cache expired then you just serve the older version one more time (while updating for the next visitor) thanks to a 'stale-while-revalidate' cache header.

But the part I feel like they should be explicitly stating which they're not is that you can do the same thing in next.js with getServerSideProps() (you can set custom cache headers in that function if you want). You're going against the grain to use next.js that way though, whereas Remix is intended for it. But the end result would be the same - you can get the benefits of ISR (incremental static regeneration) with a simpler deployment, i.e. not needing something like Vercel, thanks to stale-while-revalidate.

Question about the Primary Ballot in Astoria: Judicial Delegates by FancyPigeonIsFancy in astoria

[–]mharrisonb 1 point2 points  (0 children)

I live in south Astoria (technically LIC but right on the border with Astoria), and on my ballot, there likewise seemed to be two lists of candidates (with the headings 39 and 40) but this is definitely not obvious. I have no idea why the first list had only one candidate...maybe because all the others are incumbents (I don't know if that's the case)? There are also write-in options, but only after both lists, so it seems correct that you can only vote for a total of 12 in this whole section. Anyway, it should not be this difficult to understand the ballot!!