Live data from Hacker News

Writing JavaScript without a build system

jvns.ca

171–180 of 187 posts

Re: Writing JavaScript without a build system

#171
post #168

Earlier quoted context omitted.

python is rarely streamed across HTTP, I believe that's the reason js is treeshaked.

Guido is the one who picked Python's name. Wikipedia actually has an entire article on the history of Python: https://en.wikipedia.org/wiki/History_of_Python >

Plausible but not sure it's entirely relevant. Most libs have parts that aren't used all the time. A lib that has no redundant parts is either a gem or a minuscule thing that will create a lot of miniscule deps.

Re: Writing JavaScript without a build system

#172

With JS having `import` these days, there really is zero point in bundling if you're writing normal modern JS. Just let the browser deal with caching, it's good at that, it's literally half of what it's been optimized for. The other half being JS execution.

Is JS import similar to Python import?

Re: Writing JavaScript without a build system

#174

Earlier quoted context omitted.

You can easily build complex UIs without a framework. Chrome DevTools, Chrome OS, Photoshop, Firefox and other very complex apps have been built with web components.

Web Components aren’t an alternative to React so much as a complementary technology. Yes, you can build UIs without a reactive framework but it will involve compromises in expressivity, code organization, and whatever the Greenspun equivalent is for React.

Web components do not imply a lack of reactivity. JavaScript accessors, observed attributes, and a declarative template library give you as much reactivity as React. Photoshop and Chrome are built with reactive web components.

Re: Writing JavaScript without a build system

#177
post #99

Earlier quoted context omitted.

Ah, thanks! I'd never encountered these before. It seems like a handy way to make my code match the code in documentation that assumes a Node environment.

No problem! There's also a polyfill if you need to support Safari: https://github.com/guybedford/es-module-shims

Thankfully iOS 16.4 will be natively supporting import maps so fingers crossed this might be easier soon

https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-a...

Re: Writing JavaScript without a build system

#180
post #61
post #16

Earlier quoted context omitted.

I wonder how far fetched it would be to have just the syntax of Typescript on the browser without type-checking. We'd have to use tsc locally only for the typechecking, without the need of a build process, but that would be enough for me. I know there's JSDoc but the normal syntax is so much better. EDIT: Looks like there's a proposal: https://github.com/tc39/proposal-type-annotations

IIRC that's how the Flow type annotations worked, but of course it lost out to TypeScript.

Correct, but to be more precise, both Typescript and Flow allow for both JSDoc and the more common TS-like syntax.
Post reply on HN