Skip to content

Rename JS-specific concepts #26795

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

Merged
merged 6 commits into from
Sep 12, 2018
Merged

Rename JS-specific concepts #26795

merged 6 commits into from
Sep 12, 2018

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Aug 30, 2018

  1. Assignment declaration — an assignment that is treated like a declaration. Previously called [JS] special (assignment|declaration), among other things.
  2. Expando — a value that can be used as a target in assignment declarations. Currently, a class, function or empty object literal. Functions are allowed in Typescript, too. Previously called a JS container, JS initializer or expando object.
  3. JavaScript → Javascript. This is annoying to type, and looks like 'Java Script' in a camelCase world.

Everything is a pure rename as far as I know. The only test change is the API baselines, which reflect the rename from SymbolFlags.JSContainer to SymbolFlags.Assignment.

If you have better ideas for names, please mention them. @RyanCavanaugh and I agree that the best technical term for expando is "Assignment declaration target", but I think this is unwieldy for use in function names.

1. Assignment declaration -- an assignment that is treated like a
declaration. Previously called [JS] special (assignment|declaration),
among other things.
2. Expando -- a value that can be used as a target in assignment
declarations. Currently, a class, function or empty object literal.
Functions are allowed in Typescript, too. Previously called a JS
container, JS initializer or expando object.
3. JavaScript -> Javascript. This is annoying to type, and looks like
'Java Script' in a camelCase world.

Everything is a pure rename as far as I know. The only test change is
the API baselines, which reflect the rename from SymbolFlags.JSContainer
to SymbolFlags.Assignment.
@sandersn sandersn requested review from a user and RyanCavanaugh August 30, 2018 21:47
@sandersn sandersn changed the title Rename js concepts Rename JS-specific concepts Aug 30, 2018
@@ -3432,7 +3432,7 @@ namespace ts {
ExportStar = 1 << 23, // Export * declaration
Optional = 1 << 24, // Optional property
Transient = 1 << 25, // Transient symbol (created during type check)
JSContainer = 1 << 26, // Contains Javascript special declarations
Assignment = 1 << 26, // Assignment treated as declaration (eg `this.prop = 1`)
Copy link

Choose a reason for hiding this comment

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

The comments make it sound like the meaning changed -- previously this would be the symbol for the thing you're assigning to properties of, now it sounds like the symbol for a particular assignment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I just merged #26690, which puts this flag on all assignment declarations, not just ones that are themselves containers. I decided to put all the renames in this PR, though.

@gcnew
Copy link
Contributor

gcnew commented Aug 31, 2018

Javascript reads weirdly. JavaScript / js are better IMHO.

@ghost
Copy link

ghost commented Sep 4, 2018

By the way, be sure to make a note in API breaking changes for any public names changed.

Note that this introduces a variable name collision in a couple of
places, which I resolved like this:

```ts
const isInJavascript = isInJSFile(node);
```
@sandersn
Copy link
Member Author

sandersn commented Sep 5, 2018

@gcnew OK, I switched Javascript to JS. I don't think anybody will be confused about its meaning, so it's a good abbreviation.

@Andy-MS Right now the only public change is renaming JSContainer → Assignment, so it should be a small note.

@RyanCavanaugh
Copy link
Member

@sandersn 👍 from me

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Sep 11, 2018

I really would prefer we stay consistent about spelling the names with the appropriate capitalization. We already had "TypeScript" and "JavaScript" as names in the compiler.

@sandersn
Copy link
Member Author

@DanielRosenwasser I hope to switch entirely to TS or JS. Any opinions on Ts vs TS?

@sandersn sandersn merged commit 6bd1da2 into master Sep 12, 2018
@sandersn sandersn deleted the rename-js-concepts branch September 12, 2018 17:44
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.

4 participants