Live data from Hacker News

Why we switched from Webpack to Vite

blog.replit.com

141–150 of 229 posts

Re: Why we switched from Webpack to Vite

#141
post #73

Earlier quoted context omitted.

I can remove babel in my code?

It depends on your target platform: ES6 modules are basically supported in every browser I care about, so the major reason for Babel is JSX

Even if your target platform didn't have ES6 modules, Babel is probably not the tool you'd want to transpile those with. Let the bundler (which is the topic of the discussion here so I assume a bundler is used) handle them. Tree shaking works better that way anyway.

Also if JSX or similar JS extensions are the only thing you need tramspiling for, you might want to look at Sucrase [1] as a fast alternative to Babel.

https://github.com/alangpierce/sucrase

Re: Why we switched from Webpack to Vite

#143

I switched over to Vite from Parcel, as Parcel v2 seems to be a mess with no actual concrete release date, and not everything plays nicely with v1. Vite + Typescript + Tailwind JIT = perfect imo.

Hi, Parcel maintainer here. v2 will be released very shortly. We are ~1 month away from rc. Also, we should have a very big announcement about build perf in the next couple days. Apologies for the long pre-release cycle but I think the light is finally at the end of the tunnel. :)

Re: Why we switched from Webpack to Vite

#144

Author of Vite here. I see many people evaluating Vite as a webpack replacement, so I want to clarify the goal of the project here: It is NOT Vite's goal to completely replace webpack. There are probably a small number of features/capabilities that some existing webpack projects rely on that doesn't exist in Vite, but those features are in the long tail and are only needed by a small number of power users who write b…

Well said – everything new does not need to be a replacement for something else. Options/choices are good, especially because each one can lean into a different solution space.

Re: Why we switched from Webpack to Vite

#145
Ah, the classic build tool evolution cycle! 1. Become frustrated with complex build tool

2. Write a new tool that is dead simple, opinionated (your opinions), convention over configuration, etc

3. Post to HN

4. Achieve adoption

5. As more people use the tool, feature creep ensues

6. In order to satisfy diverse use cases, make everything modular and configurable!

7. Tool slows and becomes impossible to manage

8. GOTO 1.

Re: Why we switched from Webpack to Vite

#146

Earlier quoted context omitted.

As the "webpack" guy on my team, these numbers look extremely compelling, but I also know Webpack does a lot for us (e.g., through Webpack v4, it includes browserfied node libs as needed). Beyond node libs, there's a long tail of niche things that need to be taken of... am I trading coverage of that long tail for speed?

You still need webpack for production build :). So all is good.

I use esbuild for prod...?

Re: Why we switched from Webpack to Vite

#147
post #101

Earlier quoted context omitted.

>Super excited about the future of JavaScript tooling ecosystem with more focus on efficiency and speed. Well they can't get worse than now... 234mb for a friggin hello world app

Would you count the size of the JVM when you do Hello World in Java?

Java HelloWorld runs in 1mb:

  20:18:01 /tmp > echo 'public class HelloWorld {public static void main(String[] args) {System.out.println("Hello World!");}}' > HelloWorld.java
  20:18:09 /tmp > javac HelloWorld.java
  20:18:14 /tmp > java -Xmx1m HelloWorld
  Hello World!

Re: Why we switched from Webpack to Vite

#148

Author of Vite here. I see many people evaluating Vite as a webpack replacement, so I want to clarify the goal of the project here: It is NOT Vite's goal to completely replace webpack. There are probably a small number of features/capabilities that some existing webpack projects rely on that doesn't exist in Vite, but those features are in the long tail and are only needed by a small number of power users who write b…

If someone is already comfortable with webpack or something else and has no complaints or issues with it, how would you sell them on trying vite?

Re: Why we switched from Webpack to Vite

#149
post #74

Earlier quoted context omitted.

They probably mean that "hello world".length == 11 // bytes

Is it? I know there's no sizeof, but what would be sizeof(char) in JS? 1 byte?

The answer to this question is complicated. JavaScript char encoding is roughly UTF-16, which is 2-bytes, but the byte you read may have been part of a surrogate so, depending on your first one, you must read the next 2 bytes to complete your character.

And of course, this basic explanation doesn’t really do justice to answering your question, because depending on your definition of what a “character” is, you may need to take into account ligatures etc.

Post reply on HN