You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's amazing to me that someone is taking the time to update @types/sequelize, to keep it in sync with sequelize. It's much easier FOR EVERYONE to just write sequelize in TS.
I didn't understand your first point.
It includes an extra build step which prevent installation over git (what does this mean?)
Contribution barrier is increased - maybe. But you will get higher quality contributions. And it's easier to contribute when the language is statically typed.
I don't have time to use a huge library that's not written with static types. Sorry.
Reacted by Nico Chaves, xiaoke, Mark, J++, Bartosz Brzeziński, Boris, Bosn and Michael Gates
It includes an extra build step which prevent installation over git (what does this mean?)
You can install node modules from git address
Contribution barrier is increased - maybe. But you will get higher quality contributions. And it's easier to contribute when the language is statically typed.
I don't believe we will receive higher quality contributions just because we are using a certain type system. It will be easier to spot bugs and better code hinting may be, but contribution quality will remain same plus we will receive even less contributions.
I don't have time to use a huge library that's not written with static types. Sorry.
I think you misunderstood, I am all in for improving this library (doing that from past 2 years). But "rewrites" take time, we have to judge when its ok to do that when its not.
re: You can install node modules from git address...you can do this if you use TypeScript or JS. I really don't understand what you are saying.
A rewrite into TypeScript will probably take 2-5 days depending on experience with TypeScript, and it is actually quite fun to do. I promise that the Sequelize library will be much higher quality after converting to TS. The best thing to do is make sure you have good tests, and that the tests pass before/after converting to TS.
I agree with @aegenet, Sequelize is huge in terms of functionality unfortunately that means it's usage can become really complex (and error prone) at times.
When I moved out backend system to TS I found many errors/bugs due to bad Sequelize usage (example is accidently passing the where clause directly into findMany) which Sequelize didn't even warn about.
Demanding @sushantdhiman to port the entire code base is really out of the question, while I would love to see Sequelize go full TS, I fully understand the enormous amount of work involved.
I would however ask @sushantdhiman if you would re-consider shipping typings with the package, the current ones at @types are pretty bad (they are shipping v3 typings pretending to be v4) and are used by many.
@ORESoftware what are using with TypeScript?
I rewrote my project using TypeScript and man, sequelize now became unusable because it feels like I'm fighting with compiler to just compile my code.
I know about TypeORM but I'm not sure at this point, I really like sequelize but lack of real TypeScript supports makes me start to look for replacement because declaring models, fields and class/instance methods is out of this world.
Reacted by Alexander Mills, Nico Chaves, Wei-Liang Liou, D, Mark, J++ and Jerome S.
We have been using TypeORM on several projects, but the support has been lacking and quite frankly it lacks a well thought architecture, making it hard to extend (ie. custom types). The number of issues is constantly rising, and the devs don't have the time to maintain it properly (which I 100% understand, that's the risk with OS software).
So we are thinking about switching to sequelize. We have used it on several JS projects, but since last year we work 100% in TS, for a lot of reasons (tl:dr => it's great, and better in every way). We are looking at sequelize-typescript, but if the official repo was packing typings, or better, switching slowly to TS, that would be huge win for everyone (even people not using typescript).
Reacted by gabrielDevlog, Godefroy, Totomakers, Ronan, Alex Soncodi, Max Stern, J++, Bartosz Brzeziński, plusmancn and Bosn
To clarify, you want just the typings, not a build step correct?
The thing is there is already an existing set of typings, I don't really have the time (nor do I want) to redo them.
I will create a PR that contains all typings to give you an overview.
The point in shipping your own typings is you don't rely on an an external project to maintain them for you and you are in control of them in case you make updates etc.
The point in shipping your own typings is you don't rely on an an external project to maintain them for you and you are in control of them in case you make updates etc.
Activity
sushantdhiman commentedon Apr 10, 2018
We discussed this before, proposal was rejected
ORESoftware commentedon Apr 10, 2018
It's amazing to me that someone is taking the time to update
@types/sequelize, to keep it in sync withsequelize. It's much easier FOR EVERYONE to just writesequelizein TS.I didn't understand your first point.
sushantdhiman commentedon Apr 10, 2018
You can install node modules from git address
I don't believe we will receive higher quality contributions just because we are using a certain type system. It will be easier to spot bugs and better code hinting may be, but contribution quality will remain same plus we will receive even less contributions.
I think you misunderstood, I am all in for improving this library (doing that from past 2 years). But "rewrites" take time, we have to judge when its ok to do that when its not.
You can still use https://github.com/RobinBuschmann/sequelize-typescript which I think it working great for many people.
As you have planned to leave Sequelize, I suggest https://github.com/typeorm/typeorm which got better typescript support
ORESoftware commentedon Apr 10, 2018
@sushantdhiman many people appreciate your work
re: You can install node modules from git address...you can do this if you use TypeScript or JS. I really don't understand what you are saying.
A rewrite into TypeScript will probably take 2-5 days depending on experience with TypeScript, and it is actually quite fun to do. I promise that the Sequelize library will be much higher quality after converting to TS. The best thing to do is make sure you have good tests, and that the tests pass before/after converting to TS.
aegenet commentedon Apr 12, 2018
@ORESoftware For the information, we are currently converting our fork of Sequelize to Typescript.
Hum... converting yes, but a rewrite, no. It's not a "day" trip.
Sequelize is an es5 javascript project, a part of code is not done right with strange hacks (Hello
Model.js).We have completed the code conversion. But now we are on the biggest part : cleanup and rewrite.
Don't get me wrong, I think Sequelize is already a great ORM, but for us, it is not maintainable in javascript.
SimonSchick commentedon Apr 26, 2018
I agree with @aegenet, Sequelize is huge in terms of functionality unfortunately that means it's usage can become really complex (and error prone) at times.
When I moved out backend system to TS I found many errors/bugs due to bad Sequelize usage (example is accidently passing the
whereclause directly intofindMany) which Sequelize didn't even warn about.Demanding @sushantdhiman to port the entire code base is really out of the question, while I would love to see Sequelize go full TS, I fully understand the enormous amount of work involved.
I would however ask @sushantdhiman if you would re-consider shipping typings with the package, the current ones at
@typesare pretty bad (they are shipping v3 typings pretending to be v4) and are used by many.The ones written by @felixfbecker (https://github.com/types/sequelize) are pretty decent, they are extremely detailed and often document things that aren't even clearly visible on the official docs without taking a code deep dive.
Furthermore shipping the typings would be a great sanity check for changes.
In any case @aegenet I'm interested in this port, where can I contribute? 😛
ORESoftware commentedon Apr 26, 2018
@SimonSchick separate typings are always going to be out-of-sync. It's such a headache.
Big libraries like this need to be written in a statically typed language. It's just not possible for humans to catch all the bugs.
I am not asking @sushantdhiman to port to TS. I don't currently use Sequelize. All I am saying is I won't use it unless it's written in TS.
mxs42 commentedon Jun 16, 2018
@ORESoftware what are using with TypeScript?
I rewrote my project using TypeScript and man, sequelize now became unusable because it feels like I'm fighting with compiler to just compile my code.
I know about TypeORM but I'm not sure at this point, I really like sequelize but lack of real TypeScript supports makes me start to look for replacement because declaring models, fields and class/instance methods is out of this world.
sushantdhiman commentedon Jun 23, 2018
Reopen issue to track support for official TypeScript typings for Sequelize
[-]Convert this to TypeScript[/-][+]Ship official TypeScript typings[/+]1 remaining item
SimonSchick commentedon Jun 23, 2018
😮
aegenet commentedon Jun 25, 2018
Just for informations : https://github.com/konnecteam/ts-sequelize (v4) (with Oracle support)
We will upgrade next month to this version for our commercial product (currently we have used our JS fork with many fixes).
Next steps :
mxs42 commentedon Jul 4, 2018
@aegenet wait, what is this? Did you rewrite the whole sequelize using TypeScript?
Any docs/examples?
RDeluxe commentedon Oct 1, 2018
Wo @aegenet that's a great job, congrats.
We have been using TypeORM on several projects, but the support has been lacking and quite frankly it lacks a well thought architecture, making it hard to extend (ie. custom types). The number of issues is constantly rising, and the devs don't have the time to maintain it properly (which I 100% understand, that's the risk with OS software).
So we are thinking about switching to sequelize. We have used it on several JS projects, but since last year we work 100% in TS, for a lot of reasons (tl:dr => it's great, and better in every way). We are looking at sequelize-typescript, but if the official repo was packing typings, or better, switching slowly to TS, that would be huge win for everyone (even people not using typescript).
SimonSchick commentedon Oct 31, 2018
@sushantdhiman I'm still willing to supply some reasonable battle tested typings that are up to date with v5.
Would you be willing to accept a PR? :)
SimonSchick commentedon Nov 24, 2018
@sushantdhiman would you mind a PR?
sushantdhiman commentedon Nov 26, 2018
@SimonSchick yeah no problem, but as short PRs please. I am TypeScript newbie :D
Start with Sequelize class may be
SimonSchick commentedon Nov 26, 2018
To clarify, you want just the typings, not a build step correct?
The thing is there is already an existing set of typings, I don't really have the time (nor do I want) to redo them.
I will create a PR that contains all typings to give you an overview.
sushantdhiman commentedon Nov 26, 2018
Yes, I don't want to convert this project to Typescript yet, but we can provide typings.
Then what is the point of having those typing shipped by Sequelize, they could be updated at their source. Aren't those typings properly maintained
SimonSchick commentedon Nov 26, 2018
The typings available on DT are really outdated and incorrect in many ways, I use a fork of
the no longer maintained https://github.com/types/sequelize for my typings, which are the typings I was going to suggest we ship with sequelize.
The point in shipping your own typings is you don't rely on an an external project to maintain them for you and you are in control of them in case you make updates etc.
sushantdhiman commentedon Nov 26, 2018
I heard @felixfbecker used to maintain some good quality typings, may be use them. Or grab them from https://github.com/konnecteam/ts-sequelize npm repo and improve them. Please use base typings from whatever project you think are the best
Yeah I agree
SimonSchick commentedon Nov 26, 2018
@sushantdhiman ts-sequelize seems to have many many changes compared to sequelize and isn't really compatible.
sushantdhiman commentedon Nov 27, 2018
@SimonSchick Please use base typings from whatever project you think are the best