Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: emit pure annotations to static property initializers #43344

Closed
wants to merge 2 commits into from
Closed

fix: emit pure annotations to static property initializers #43344

wants to merge 2 commits into from

Conversation

alan-agius4
Copy link
Contributor

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}a
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```
Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```
@alan-agius4 alan-agius4 added area: animations action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release labels Sep 4, 2021
@ngbot ngbot bot modified the milestone: Backlog Sep 4, 2021
@google-cla google-cla bot added the cla: yes label Sep 4, 2021
@alan-agius4
Copy link
Contributor Author

alan-agius4 commented Sep 4, 2021

Needed to address size check failures in #42598

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: merge The PR is ready for merge by the caretaker labels Sep 8, 2021
AndrewKushnir pushed a commit that referenced this pull request Sep 9, 2021
#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close #43344
AndrewKushnir pushed a commit that referenced this pull request Sep 9, 2021
)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}a
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close #43344
AndrewKushnir pushed a commit that referenced this pull request Sep 9, 2021
#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close #43344
@alan-agius4 alan-agius4 deleted the pure-annotation-comments-workaround branch September 9, 2021 16:22
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 16, 2021
…ular#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}a
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close angular#43344
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 16, 2021
angular#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close angular#43344
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 22, 2021
…ular#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}a
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close angular#43344
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 22, 2021
angular#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close angular#43344
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: animations area: core Issues related to the framework runtime cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants