Repository navigation
Conversation
|
Thank you! |
|
Wow! Thank you too |
|
What about documentation? We have a note in docs about optionality of constructor parameter (https://typeorm.io/#/entities). It should be updated in next branch too. |
|
I just found one issue with this change. Right now property initializations won't work with this change: export class Post {
@Column()
isLoaded = false
}we don't get isLoaded initialized. I'm not yet sure about this behaviour, but it looks right too. But I would like to get your thoughts about it. Is it something expected now? Adding @nicomouss too. |
|
@pleerock It's expected in my opinion |
|
Same here, it's expected as constructor is skipped when entities are built from the ORM. Thus properties initialisations are also skipped. |
|
Right now 3 tests in |
|
Any prospects when this would be released? |
|
@pkuczynski its already released |
|
Hmm, this is strange and does not seem to work for ActiveRecord. My example: export class Car extends BaseEntity {
@PrimaryGeneratedColumn()
id: number
registration: string
constructor() {
console.log('Constructor has been called')
}
}And when I call I thought this PR would prevent constructor from being called? I am using version |
|
This change is only available for 0.3.x version. It's released under @next tag. |
|
|
|
I believe some folks use @next in production environments. I think is preety stable right now, but it would be best to ask people who actually use it daily to tell if they think it's usable in production. |
|
Got it! Thanks for the detailed explanation. Do you have any high-level description of changes introduced by 3.0? |
|
0.3.0 wasn't released, so there is no migration guide or similiar documents. You can check changelog - some of the changes are pointed out there. |
I basically copied the code submitted by @pepakriz into a new branch created against
next, only I used JS'sReflectinstead ofObjectInstantiator).Original PR: #1773