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
When compiling with the typescript compiler (tsc), how class fields are transformed depends on the value of useDefineForClassFields, but the tsup is currently ignoring this setting.
This causes problems with field decorators.
Original typescript code:
export class Foo {
@customDecorator()
public readonly value!: string;
}
Result of tsc with useDefineForClassFields = false
Result of tsup regardless of useDefineForClassFields value
var Foo = class {
constructor() {
__publicField(this, "value");
}
}
The issue here is that the __publicField() logic which is being added, prevents processing of field decorators.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
paulsmithkc
changed the title
tsup ignores useDefineForClassFields always generates definitions for class class fields
tsup ignores useDefineForClassFields, and always generates definitions for class class fields
Apr 5, 2024
paulsmithkc
changed the title
tsup ignores useDefineForClassFields, and always generates definitions for class class fields
tsup ignores useDefineForClassFields, and always generates definitions for class fields
Apr 5, 2024
When compiling with the typescript compiler (
tsc
), how class fields are transformed depends on the value ofuseDefineForClassFields
, but thetsup
is currently ignoring this setting.This causes problems with field decorators.
Original typescript code:
Result of
tsc
withuseDefineForClassFields = false
Result of
tsc
withuseDefineForClassFields = true
Result of
tsup
regardless ofuseDefineForClassFields
valueThe issue here is that the
__publicField()
logic which is being added, prevents processing of field decorators.Upvote & Fund
The text was updated successfully, but these errors were encountered: