Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Another try to not use namespace - #39344

#39344
Closed
ShuiRuTian wants to merge 9 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
ShuiRuTian:try-not-use-namespaceShuiRuTian/TypeScript:try-not-use-namespaceCopy head branch name to clipboard
Closed

Another try to not use namespace#39344
ShuiRuTian wants to merge 9 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
ShuiRuTian:try-not-use-namespaceShuiRuTian/TypeScript:try-not-use-namespaceCopy head branch name to clipboard

Conversation

@ShuiRuTian

Copy link
Copy Markdown
Contributor

Fixes #

@ShuiRuTian

ShuiRuTian commented Jul 1, 2020

Copy link
Copy Markdown
Contributor Author

Question1:

namespace ts{
        export const enum SyntaxKind {
        Unknown,
        EndOfFileToken,
        SingleLineCommentTrivia,
        MultiLineCommentTrivia,
        NewLineTrivia,
        }
}

var q = (ts as any).SyntaxKind;

const enum SyntaxKind {
    Unknown,
    EndOfFileToken,
    SingleLineCommentTrivia,
    MultiLineCommentTrivia,
    NewLineTrivia,
}

// How to get SyntaxKind like under namespace?

For now I generate a new file and copy everything in need expect the "const" keyword.

@ShuiRuTian

ShuiRuTian commented Jul 1, 2020

Copy link
Copy Markdown
Contributor Author

Some aim:

  1. remove all "ts" namespace, keep others for temp. (ts.XX keeps too)
  2. NOT change indent, so review could be possible.
  3. use script to do heavy work, but manually check all again and fix error.

Some sequelae caused by this branch:

  1. some variable are renamed, they are usually added "NameSpaceLocal" suffix.
  2. indent in some test files and their baseline are changed.

How to deal with namespace:

  1. for those which only have one (in another word, not merged)
    1. if it is used in multi projects, keep namespace and export it.
    2. if it is only used in one project, just delete the namespace and remove the namespace name in used place
  2. for those which have multi parts (merged)
    How to do with it?

why importTracker.ts is not in findAllReference.ts?

@weswigham

Copy link
Copy Markdown
Member

@ShuiRuTian FYI, #35561 already does this and is (re)generated by script. We're mostly just blocked on an API Extractor feature so we can preserve the same file layout in our API as today.

@ShuiRuTian

Copy link
Copy Markdown
Contributor Author

whoops, glad to know that!

@ShuiRuTian ShuiRuTian closed this Jul 2, 2020
@ShuiRuTian
ShuiRuTian deleted the try-not-use-namespace branch July 6, 2020 13:44
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.