Skip to content

Implement export as namespace from - #34903

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 33 commits into
microsoft:masterfrom
Kingwl:export_star_as
Dec 21, 2019
Merged

Implement export as namespace from#34903
Daniel Rosenwasser (DanielRosenwasser) merged 33 commits into
microsoft:masterfrom
Kingwl:export_star_as

Conversation

@Kingwl

@Kingwl Wenlu Wang (Kingwl) commented Nov 4, 2019

Copy link
Copy Markdown
Contributor

Fixes (a part of) #4813

@Kingwl Wenlu Wang (Kingwl) changed the title init export start as decl Nov 4, 2019
@Kingwl Wenlu Wang (Kingwl) changed the title [WIP] init export star as decl Nov 7, 2019
@Kingwl Wenlu Wang (Kingwl) changed the title init export star as decl Nov 7, 2019
@Kingwl
Wenlu Wang (Kingwl) marked this pull request as ready for review November 7, 2019 06:54
@ExE-Boss

Copy link
Copy Markdown
Contributor

This only addresses half of #4813. The other half being export default from, which is currently at stage 1. (unless it got moved to a separate issue)

@Kingwl

Copy link
Copy Markdown
Contributor Author

up🙆🏻‍♂️

@Kingwl

Copy link
Copy Markdown
Contributor Author

Could we get this down in 3.8?🤔

@weswigham

Copy link
Copy Markdown
Member

Wenlu Wang (@Kingwl) can ya sync it with master?

@DanielRosenwasser

Copy link
Copy Markdown
Member
@DanielRosenwasser

Copy link
Copy Markdown
Member

I merged from master to fix conflicts, and I switched some of your tests to target multiple module outputs to avoid duplication (side note: I ran into #35809 while doing this which was annoying).

One thing I noticed was that you need a transform for es2015.

@weswigham

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this again now that it's up to date

export var a = 1;
export var b = 2;
//// [1.js]
export * as ns from './0';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be transformed into something like

import * as _ns from './0';
export { _ns as ns };
@DanielRosenwasser

Copy link
Copy Markdown
Member

I implemented export * as ns in ES2015, and renamed the transform and file appropriately. I think we should be good to go! 🚀

@DanielRosenwasser

Copy link
Copy Markdown
Member
@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 20, 2019

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the tarball bundle task on this PR at ed4f9b5. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/58409/artifacts?artifactName=tgz&fileId=C6440FA6CB5A138B28E2E5FE06AB428E11B9ED8E53FA33F05A6591C86C5DED9202&fileName=/typescript-3.8.0-insiders.20191220.tgz"
    }
}

and then running npm install.

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) changed the title Implement export as namespace from Dec 21, 2019
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) merged commit 4c7844b into microsoft:master Dec 21, 2019
@DanielRosenwasser

Copy link
Copy Markdown
Member

Thank you!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

7 participants