Repository navigation
Conversation
2 of 7 tasks
sdepold
previously approved these changes
Dec 30, 2021
| In TypeScript, you can add typing information without adding an actual public class field by using the `declare` keyword: | ||
|
|
||
| ```typescript | ||
| // Invalid |
Member
Author
There was a problem hiding this comment.
Good catch! Changed, it is valid :)
Member
|
do we want to have that in v7 as well and eventually remove it? |
Member
Author
|
Yes let's add it to v7 too until we've resolved #14300 :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
npm run testornpm run test-DIALECTpass with this change (including linting)?Description Of Change
There is an incompatibility between Sequelize & adding public class fields for attributes.
This PR documents how this incompatibility & explains how to add typing without introducing actual class fields that will cause bugs.
It also detects uses of public class fields that shadow a model's attributes, and warns the user. Doing this:
Will log the following to the console:
Closes #10579
Closes #12603
Closes #11675
Closes #11032
Closes #11494
Note: this documentation update is a temporary fix as things are going to break again once decorators are stage 4. I'll open an rfc with possible solutions that resolve this caveat for good for V7.