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

All Bloomberg Changes for Private Fields and Methods #6

Closed
wants to merge 1,469 commits into from

Conversation

mheiber
Copy link

@mheiber mheiber commented Aug 23, 2018

Now on the TypeScript Repo!: microsoft#30829

This is the best place to view all of Bloomberg's work on the TypeScript compiler for supporting class private fields and private methods.

This pull request shows all of our work that has been reviewed. This includes the following changes:

We have other work in progress here: https://github.com/bloomberg/TypeScript/pulls, including:

@mheiber mheiber changed the title Es private fields [WIP] All Bloomberg Changes Aug 23, 2018
@mheiber mheiber changed the title [WIP] All Bloomberg Changes All Bloomberg Changes Sep 25, 2018
@mheiber mheiber changed the title All Bloomberg Changes All Bloomberg Changes for Private Fields and Methods Sep 25, 2018
IllusionMH and others added 26 commits October 1, 2018 23:11
Infer array rest as tuple if possible
Refactoring to unify updating no input files error
Default logger for projectService has assert on exceptions being logged in tsserver
Don't complain about `modules` and `outFile` options when `emitDeclarationOnly` is set.
Remove unneeded `argName` check, because it always evaluates to `true` (the `false` case is handled just before the modified line)
Small refactoring of getTransformationBody
* Fix GH#18217 issue for FileLog.

* Refactor FileLog class to not use isEnabled property.
…-exception-27338

Use safe some function to handle undefined declarations (fixes microsoft#27338)
…extends-helper

adding missing semi-colon to extendsHelper
chore(package.json): http -> https, add www. for homepage
TypeScript must hoist accessors for super properties when converting
async method bodies to the `__awaiter` pattern for targets before
ES2016.

Previously, TypeScript would reify all property accesses into element
accesses, i.e. convert the property name into a string parameter and
pass it to `super[...]`. That breaks optimizers like Closure Compiler or
Uglify in advanced mode, when property renaming is enabled, as it mixes
quoted and un-quoted property access (`super['x']` vs just `x` at the
declaration site).

This change creates a variable `_superProps` that contains accessors for
each property accessed on super within the async method. This allows
accessing the properties by name (instead of quoted string), which fixes
the quoted/unquoted confusion. The change keeps the generic accessor for
element access statements to match quoting behaviour.

Fixes microsoft#21088.
* rename _super to _superIndex and _superProps to _super.
* reinstate early exit for transformers by marking super accesses as
  esnext/es2017 in `binder.ts`.
* adjust comment in `checker.ts` to new emit.
Andy and others added 15 commits October 26, 2018 14:44
- Narrow unknown
- Narrow union members (in addition to filtering)
…microsoft#28141)

* JSX uses mixed signatures and union sigs use subtype on partial match

* Small improvement
…eConstraint

No constraint for { [P in K]: XXX } where K is type variable
…icrosoft#27804)

* Measure variance of aliased conditional types using variance markers

* Just do variance probing for all type aliases

* Small limiter for predictability

* Inline property set, remove unused functions
…g when invoked. (microsoft#28206)

* Do not ts-ignore noImplicitAny suggestions

Still need to write tests.

* Add tests

* More tests

* Update baselines
and check that private names not used in parameters

Signed-off-by: Max Heiber <max.heiber@gmail.com>
Signed-off-by: Max Heiber <mheiber@bloomberg.net>
Joseph Watts and others added 3 commits November 12, 2018 15:46
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
* Add baselines

* Update baselines

Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Moves the transformation of class properties to the ESNext transformer.

Property initializers are moved to the constructor by the TypeScript transformer only if there is constructor parameter properties. This is to preserve property initialization order.

It currently does not produce void 0 initializers for property declarations that have no initializer due to ESNext and TypeScript having different runtime behaviors. TS completely elides property declarations with no initializer, while I believe the ESNext would define that property on the instance with an undefined value (which is observable at runtime - propertyName in instance or for (var prop in instance) {}).
Joseph Watts and others added 8 commits December 10, 2018 11:05
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Fix display of private names in the TS Language Server
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
@mheiber mheiber closed this Dec 20, 2018
acutmore pushed a commit that referenced this pull request Mar 29, 2021
* wip: add types

* wip

* Add cases

* Add some case

* Add more check

* accept baseline

* add abstract abd declare method

* add override in declaration

* accept baseline

* add property override

* Fix decalre modifier

* update baseline

* Add more cases

* make lint happy

* make lint happy

* Update description

* Add codefix

* simplify code

* accept baseline

* Update desc

* Accept baseline

* Add override completions

* filter out implements field in override context

* fix tests

* Add parameter property check

* Accept baseline

* acept baseline

* Add parameter property to declaration code action

* Add quickfix for override parameter property

* fix code style

* Add override with interface tests

* Add more cases about modifier position

* rename flag

* rename flags

* Added tests.

* Accepted baselines.

* Always issue errors for unnecessary 'override' modifiers.

* Accepted baselines.

* Override perf (#4)

* try cache check result

* pre check for override

* Do not issue error if implement abstract

* Add abstract-spec check

* Avoid override dead lock

* Add more case

* Add codefix for new error

* Fix error message

* Add jsdoc override tag (#6)

* Override jsdoc tag (#7)

* accept baseline

* Disallow codefix in js

* update baseline

* Omit override in d.ts

* Add more case in js

* Accept baseline

* fix override js test

* fix crlf

* Revert merge conflict changes

* Accept baseline

* Avoid space

* Fix CR issues

* Accept baseline

* Fix typo and add more check

* Fix error name

Co-authored-by: Daniel Rosenwasser <Daniel.Rosenwasser@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.