Hacker News new | ask | show | jobs
by stevebmark 1272 days ago
> Later in the year, Rails retired Webpacker

Is Rails anti Typescript? It’s weird to see most other JS environments move to Typescript by default, while Rails now now ignores the ability to use it without jumping through hoops.

4 comments

Depending on what your app is, I've found server-side rendering to be superior in nearly every way. I don't use Rails but Django is the same way. Django templates, bootstrap, jQuery and sprinkle in a little bit of HTMX here and there and my productivity has never been higher.
If you are building for a single target (aka web browser) I agree, it’s very easy to access your ORM with SSR.

But if you plan to support multiple targets (web, mobile, headless) then you have to develop an api anyway so why not use the best front end framework for each of your targets?

The Basecamp folks feel that web and mobile are the same target: https://turbo.hotwired.dev/handbook/native

Rails doesn't stop you from building a backend for your React and React Native frontends, for example just look at Shopify.

> Is Rails anti Typescript? It’s weird to see most other JS environments move to Typescript by default, while Rails now now ignores the ability to use it without jumping through hoops.

Have you not paid attention to the direction Rails is going? Hotwire (Rails' default front end) is all amount rendering HTML directly (not via JS) and using the absolute bare minimum amount of vanilla Javascript (with Stimulus). It's not React... So why would it need TypeScript's features and added complexity?

The whole point is using vanilla ES6 without a compilation step...

If Hey has shown me anything, it is that Hotwire IMO is a complete gimmick. The frontend of Hey had so many issues for me. I used used hey from release until about a month or two ago, and it was the terrible UXUI experience that pushed me to cancel. Weird loading issues, things would update after performing actions, not loading in place correctly etc.
If you think Hey’s UI is bad, you should try Basecamp
Could you provide some examples? I use basecamp 8+ hours a day and have no idea what you have in mind.
My post was mostly in jest. I’m well aware the “method_missing” crew has no desire to statically analyze their programs.
Webpacker was a wrapper for webpack, which was an attempt to make webpack easy to use but instead added unnecessary complexity.

You can use Rails with React/Vue + TypeScript pretty easily by using something like rails-esbuild or vite_ruby.

I'm currently working on a project with Rails, React, TypeScript, Vite, and InertiaJS and have been very much enjoying it, especially now that Inertia supports SSR.

I just started a new Rails app for a side project and while Webpacker has been retired, there are still options for Typescript. For example, I'm using esbuild and it works with Typescript out of the box - no hoops to jump through.