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

Move type helpers from nested namespace to the top-level namespace #3293

Open
dilame opened this issue Jul 17, 2024 · 4 comments
Open

Move type helpers from nested namespace to the top-level namespace #3293

dilame opened this issue Jul 17, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@dilame
Copy link
Contributor

dilame commented Jul 17, 2024

What is the problem this feature would solve?

Is there a particular reason of having type helpers in nested namespace e.g. Effect.Effect.Success, Stream.Stream.Success? It feels cumbersome to use it like this

What is the feature you are proposing to solve the problem?

I checked some modules and didn't found conflicts. What do you think about moving these type accessors to the top level e.g. Effect.Success, Stream.Success, mark Effect.Effect.Success as deprecated and remove in the next major?

Just BTW – TypeScript team consider namespaces as mistake
https://www.youtube.com/watch?v=tXK50czRbdA&t=990s (interview of Anders Hejlsberg – the creator of TypeScript)

@dilame dilame added the enhancement New feature or request label Jul 17, 2024
@tim-smart
Copy link
Member

At some point we will likely change strategy for the inference helpers: #2982

@mikearnaldi
Copy link
Member

At some point we will likely change strategy for the inference helpers: #2982

it's not a change of strategy, it's an addition to, the type helpers don't work always for example you can't use interface X extends typeof A.B

@mikearnaldi
Copy link
Member

What is the problem this feature would solve?

Is there a particular reason of having type helpers in nested namespace e.g. Effect.Effect.Success, Stream.Stream.Success? It feels cumbersome to use it like this

What is the feature you are proposing to solve the problem?

I checked some modules and didn't found conflicts. What do you think about moving these type accessors to the top level e.g. Effect.Success, Stream.Success, mark Effect.Effect.Success as deprecated and remove in the next major?

Just BTW – TypeScript team consider namespaces as mistake https://www.youtube.com/watch?v=tXK50czRbdA&t=990s (interview of Anders Hejlsberg – the creator of TypeScript)

runtime namespaces are considered a mistake not type level namespaces, also the "mistake" refers to a non standard JS runtime feature that crosses multiple files, it has nothing to do with nested types.

@mikearnaldi
Copy link
Member

I'd be willing to evaluate moving type extractors to the main module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants