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

Add support for "export * as name from …" #3193

Merged
merged 12 commits into from Oct 27, 2019
Merged

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #82

Description

As this syntax is now stable, we should definitely support it. This extends the same logic to this syntax as we have for namespace imports, meaning that

import * as name from 'foo';
export {name};

and

export * as name from 'foo';

are equivalent up to the point that

// foo.js
export const foo = 1;
export const bar = 2;

// bar.js
export * as foo from './foo.js'

// baz.js
import {foo} from './bar.js';
console.log(foo.foo);

becomes

const foo = 1;
console.log(foo);

@codecov
Copy link

codecov bot commented Oct 27, 2019

Codecov Report

Merging #3193 into master will increase coverage by 0.43%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3193      +/-   ##
==========================================
+ Coverage   90.19%   90.63%   +0.43%     
==========================================
  Files         167      167              
  Lines        5907     5905       -2     
  Branches     1797     1792       -5     
==========================================
+ Hits         5328     5352      +24     
+ Misses        350      336      -14     
+ Partials      229      217      -12
Impacted Files Coverage Δ
src/ast/nodes/ExportAllDeclaration.ts 100% <ø> (+40%) ⬆️
src/finalisers/iife.ts 100% <ø> (+5.4%) ⬆️
src/finalisers/esm.ts 100% <100%> (+10%) ⬆️
src/finalisers/shared/getExportBlock.ts 100% <100%> (ø) ⬆️
src/utils/pluginDriver.ts 87.5% <100%> (ø) ⬆️
src/ast/nodes/NodeType.ts 100% <100%> (ø) ⬆️
src/Chunk.ts 92.89% <100%> (ø) ⬆️
src/utils/identifierHelpers.ts 100% <100%> (+16.66%) ⬆️
src/ast/nodes/ExportNamedDeclaration.ts 100% <100%> (+11.11%) ⬆️
src/finalisers/system.ts 96.47% <100%> (ø) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f7e064...6e464e0. Read the comment docs.

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.

ES7 module syntax
1 participant