News for hackers. Stuff that matters.
Re:Show HN: A simple website for my JavaScript bundler by ianertson on Monday February 15, 2021 @07:49AM (#26142225)
What I mean with "adapts the code through static analysis" is:

1. Finds dead code and removes it 2. It converts nodejs code that isn't compatible with the browser into browser code 2. It converts JS code that isn't compatible with nodejs to nodejs code

It tries to always make things work both in nodejs and browser js.

One example is the optional chain syntax which doesn't work in nodejs but works in the browser. FJB converts it to something that works everywhere.

Re:Show HN: A simple website for my JavaScript bundler by chrismorgan on Monday February 15, 2021 @03:41PM (#26147050)
> 2. It converts nodejs code that isn't compatible with the browser into browser code 2. It converts JS code that isn't compatible with nodejs to nodejs code

I’m not sure what that lot means. Are you talking about converting CommonJS to… I dunno, ECMAScript Modules? and vice versa? And there’s plenty that’s available in the NodeJS or web environments that’s simply unavailable in the other, e.g. the "http" and "https" modules from NodeJS and the fetch() global in the web, and you often can’t translate between the two at all, and even if you can, it’d be decidedly messy.

Output format is almost orthogonal to what I understand you to be talking about. In the terms of other bundling stuff, you seem to be talking more about features of Babel rather than features of webpack/Rollup, and if so, then output format is completely orthogonal.

Re:Show HN: A simple website for my JavaScript bundler by DylanSp on Monday February 15, 2021 @08:56AM (#26142765)
Optional chaining's in Node as of v14.5.
Re:Show HN: A simple website for my JavaScript bundler by ianertson on Monday February 15, 2021 @09:00AM (#26142808)
Sure, but it was just an example of what kind of things FJB is doing to the code