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
This has been requested from some time. I have also started using Typescript (or Flow) with my projects.
There are lots of inconsistencies with internal code base, I think this migration will benefit our code base. This migration should help us with documentation as well. We are currently using esdoc which is not maintained at all.
Reacted by Lucky, Pedro Augusto de Paula Barbosa, Harry Yu, Zack Lundqvist, Carson McManus, abdullah-kasim, Georgii Kostenko, Constantin Metz, Jose Miguel Colella, Anthony Jean and 18 more
Reacted by Lucky, Pedro Augusto de Paula Barbosa, abdullah-kasim, Gabriel Debona, atzcl, Nico Jansen, Ryan J. Wessel, nastakhov and Narcis Bugeag
Is the goal to revamp the interface from the ground up, a la sequelize-typescript, or simply to convert existing functionality more-or-less as-is to TS and leave major rebuilding for later?
While I would love Sequelize to be re-engineered for many reasons, I think that would be a bridge too far as it would make being able to push a stable release move way out into the future.
The pragmatic part of me says that a simple TS-conversion, and fixing the type bugs that said conversion will expose, is the better one: the result would result in a lot less breakage and easier uptake by the users.
@sushantdhiman question for you - as master is now in the midst of this migration, if we have open PRs with merge conflicts, should we rebase them against master or change the base branch to v6?
All new bug fixes and features should use master as base branch. After merging to master a duplicate PR can be opened for v6 branch, if release is required.
Existing PRs should be based to v6 branch, but before that fix/feature can be merged in v6 a PR for master is required
@sushantdhiman thank you for the information, I will use master as a base branch for the rebase of my PR. My PR also modified types/lib/model.d.ts, specifically the BulkCreateOptions interface - I am unable to find where in current master the Typescript definitions of the model interfaces have been moved. Should I simply modify the model.js docstrings, or is there a type definition I can now modify as well?
@sushantdhiman - If there is some help required with the typescript migration - I can chip in as well. Were you planning on converting multiple files to typescript at once/ go through this for each file?
I have seen projects where adding the typescript config (with allowJs set to true) and then modifying files one by one - goes faster - as folks can spread the activity around multiple small PRs and even work on them in parallel. In the meanwhile - existing PRs do not get blocked - and conflicts (if any) are relatively easily solved.
@kf6kjg I would love to see better TypeScript support or something similar to sequelize-typescript or typeorm. But I think by migrating to TypeScript internally opens the door for better support in the future. Do the maintainers agree with that approach?
From the response to my comment I suspect that that is the goal. As I am not a maintainer I cannot answer definitively. In general the future of open source project often depends on individuals actually getting up the gumption to PR a a change and ride the critiques until it's either merged or rejected - and be there to help move other PRs forward.
I've not looked to see how far along @sushantdhiman is in this change, but from the bit of work and poking around I've done I suspect it's a much larger bite than anyone could have guessed: there's a LOT of code in here that's done in a very clever "javascript" manner that just doesn't look like it'll translate to quality TypeScript easily or quickly. No I don't have examples, it was just my passing observation.
Reacted by Constantine Antonakos, Joe Lafiosca, Brad Isbell, nastakhov and Pedro Augusto de Paula Barbosa
Hello everyone!! Thank you all for the interest in helping. Sushant left the project for personal reasons, and we have decided to postpone the TypeScript migration for now, to focus on overall maintainance of issues and PRs. I will give an update when we decide to come back to it.
Reacted by Constantine Antonakos, Ryan J. Wessel and Hanrea
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
Activity
kf6kjg commentedon Jul 3, 2020
Is the goal to revamp the interface from the ground up, a la sequelize-typescript, or simply to convert existing functionality more-or-less as-is to TS and leave major rebuilding for later?
While I would love Sequelize to be re-engineered for many reasons, I think that would be a bridge too far as it would make being able to push a stable release move way out into the future.
The pragmatic part of me says that a simple TS-conversion, and fixing the type bugs that said conversion will expose, is the better one: the result would result in a lot less breakage and easier uptake by the users.
sushantdhiman commentedon Jul 4, 2020
@kf6kjg Yes plan is to keep breaking changes minimal and mainly achieve type safely in internal code-base.
fnimick commentedon Jul 8, 2020
@sushantdhiman question for you - as master is now in the midst of this migration, if we have open PRs with merge conflicts, should we rebase them against master or change the base branch to
v6?sushantdhiman commentedon Jul 9, 2020
All new bug fixes and features should use master as base branch. After merging to master a duplicate PR can be opened for v6 branch, if release is required.
Existing PRs should be based to v6 branch, but before that fix/feature can be merged in
v6a PR formasteris requiredfnimick commentedon Jul 9, 2020
@sushantdhiman thank you for the information, I will use master as a base branch for the rebase of my PR. My PR also modified
types/lib/model.d.ts, specifically theBulkCreateOptionsinterface - I am unable to find where in current master the Typescript definitions of the model interfaces have been moved. Should I simply modify themodel.jsdocstrings, or is there a type definition I can now modify as well?sshivananda commentedon Jul 31, 2020
@sushantdhiman - If there is some help required with the typescript migration - I can chip in as well. Were you planning on converting multiple files to typescript at once/ go through this for each file?
I have seen projects where adding the typescript config (with allowJs set to true) and then modifying files one by one - goes faster - as folks can spread the activity around multiple small PRs and even work on them in parallel. In the meanwhile - existing PRs do not get blocked - and conflicts (if any) are relatively easily solved.
ConAntonakos commentedon Aug 5, 2020
@kf6kjg I would love to see better TypeScript support or something similar to
sequelize-typescriptortypeorm. But I think by migrating to TypeScript internally opens the door for better support in the future. Do the maintainers agree with that approach?kf6kjg commentedon Aug 6, 2020
From the response to my comment I suspect that that is the goal. As I am not a maintainer I cannot answer definitively. In general the future of open source project often depends on individuals actually getting up the gumption to PR a a change and ride the critiques until it's either merged or rejected - and be there to help move other PRs forward.
I've not looked to see how far along @sushantdhiman is in this change, but from the bit of work and poking around I've done I suspect it's a much larger bite than anyone could have guessed: there's a LOT of code in here that's done in a very clever "javascript" manner that just doesn't look like it'll translate to quality TypeScript easily or quickly. No I don't have examples, it was just my passing observation.
papb commentedon Jan 18, 2021
Hello everyone!! Thank you all for the interest in helping. Sushant left the project for personal reasons, and we have decided to postpone the TypeScript migration for now, to focus on overall maintainance of issues and PRs. I will give an update when we decide to come back to it.
github-actions commentedon Nov 2, 2021
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
ephys commentedon Mar 24, 2022
A bit of an update on this thread: We have been migrating the codebase to TypeScript. A lot has been done, and a lot more is underway.
We've also migrated the API reference to TypeDoc on our new website.
Finally, we have a series of RFC open with the goal of making TypeScript a first class citizen:
I'll close this issue, it's since been replaced with sequelize/meetings#6