4 ms·
We recently migrated ToolJet (https://news.ycombinator.com/item?id=27421408)'s https://news.ycombinator.com/item?id=27421408)'s server from Ruby ( Rails ) to Ty
by navaneethpk 5y ago
We recently migrated ToolJet (https://news.ycombinator.com/item?id=27421408)'s https://news.ycombinator.com/item?id=27421408)'s server from Ruby ( Rails ) to TypeScript ( Nest.js ). Our goal was to have only one language in our stack so that it will be easy for the open-source contributors. I have been working as a Ruby dev since 2015 and I really love Ruby. Initially I thought we might miss a lot of things when we switch to TS. But it turned out to be a great decision in the end.
The bad:
- Cannot compare Rails' ActiveRecord with TypeORM. TypeORM still lacks proper documentation and sometimes we even had to write raw SQL (or use the query builder feature )for joins.
- Testing using Minitest (Ruby) is easy and the code looks very clean. It is not as easy to go through our Jest tests. Also the test suite required some customisations for small stuffs like cleaning the db after every test.
- There is no clear winner for web frameworks in Node ecosystem. The framework you choose will be less adopted and less matured than Rails.
The good:
- A lot more applicants for the backend roles. We tried to hire senior Ruby developers in June and we got only a few applicants. After switching to Node, hiring has become easy.
- Having only one language in the stack is helping us get contributions from more external developers.
- Nest.js is not very opinionated, we can easily customise it to follow the conventions and directory structure followed by Rails.
We have explained more on our blog: https://blog.tooljet.com/migrating-toojet-from-ruby-on-rails-to-nodejs/ https://blog.tooljet.com/migrating-toojet-from-ruby-on-rails...
- Scarbutt 5y agoHonestly typeorm and nestjs are pretty bad.
- navaneethpk 5y agoTypeORM has a lot of issues but in our case it hasn't caused any major blockers. Most of the time the issue is with documentation and sometimes you run into issues like this: https://github.com/typeorm/typeorm/issues/316 https://github.com/typeorm/typeorm/issues/316. NestJS on the other hand is very solid. It has good documentation and a good community. We haven't faced any issues with NestJS yet.
- 88913527 5y agoNestJS has some pretty horrific default settings, like a max 1MB request payload size. And you have to write custom content-type processors for anything other than 'application/json'. So if you're doing say, file upload's over 1MB, you already have to make 2 configuration changes. But you wouldn't assume that OOTB 1 MB file upload isn't supported for what claims to be a full nuts-and-bolts web application framework.
- lcrz 5y ago> a max 1MB request payload size How would that be a bad default, when it's probably more than sufficient for 99% of the use cases out there? It's even the same default as nginx: https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size https://nginx.org/en/docs/http/ngx_http_core_module.html#cli... Nest.js is clearly targeting JSON-based CRUD apps, and the defaults are pretty good. File uploads through JSON is not as simple a problem as you try to make it. Are you using bas64 encoding and embedding it in the JSON? Are you using multipart/form-data?
- jeremycarter 5y agoWith all its warts NestJS is still a great choice if you want everything to be well structured with a touch of "enterprise grade" - whatever that means. Compliment it with an Angular front end and you've got a frontend and backend with very similar structure.