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
Feat: add syntheticNamedExports #3295
Merged
lukastaegert
merged 18 commits into
rollup:master
from
manucorporat:syntheticNamedExports
Jan 4, 2020
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8f12bb6
Feat: add syntheticNamedExports
manucorporat 90a2c3b
fix namespaces
manucorporat 96c90e2
remove getDefaultExport
manucorporat 91527b7
enable tests
manucorporat 71fca45
live references
manucorporat 95ab919
add tests
manucorporat 7481a84
fix test
manucorporat f4aa765
fix dead reference
manucorporat 0bf2edb
apply fixes
manucorporat 7ccc7b4
add test for syntheticNamedExports in transform
manucorporat 5d21b17
Merge branch 'master' into syntheticNamedExports
manucorporat 1202985
apply feedback
manucorporat 7f3e896
enable tests
manucorporat f01ed57
fix test
manucorporat d0edd56
unneeded exports check
manucorporat b4d7a17
rename SyntheticNamedExport
manucorporat fef1cd9
add docs
manucorporat 7d44c8d
Slightly clarify docs.
lukastaegert File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Module, { AstContext } from '../../Module'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One minor thing: Maybe call this a ...Variable so that it fits the names of the other variable types There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done! |
||
import { InclusionContext } from '../ExecutionContext'; | ||
import ExportDefaultVariable from './ExportDefaultVariable'; | ||
import Variable from './Variable'; | ||
|
||
export default class SyntheticNamedExport extends Variable { | ||
context: AstContext; | ||
defaultVariable: ExportDefaultVariable; | ||
module: Module; | ||
|
||
constructor(context: AstContext, name: string, defaultVariable: ExportDefaultVariable) { | ||
super(name); | ||
this.context = context; | ||
this.module = context.module; | ||
this.defaultVariable = defaultVariable; | ||
this.setRenderNames(defaultVariable.getName(), name); | ||
} | ||
|
||
include(context: InclusionContext) { | ||
if (!this.included) { | ||
this.included = true; | ||
this.context.includeVariable(context, this.defaultVariable); | ||
manucorporat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still wondering about this check. Shouldn’t L450-L456 make sure that this condition is always fulfilled because otherwise we would have done an early return there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups! done