-
-
Notifications
You must be signed in to change notification settings - Fork 372
Fix: Async component loader wrong path for 'async!...' imports #50
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
Merged
developit
merged 5 commits into
preactjs:master
from
rkostrzewski:fix/async-component-loader
May 25, 2017
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cad989d
Merge branch 'developit/master'
rkostrzewski af49e27
Merge branch 'developit/master'
rkostrzewski a2e5929
fix: wrong build path for 'async!' imports. Fixes #47
rkostrzewski 2259f4a
fix: Incorrect async-component-loader refactor
rkostrzewski e2cad10
chore: Configure eslint & fix linting errors
rkostrzewski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -35,4 +35,4 @@ export default asyncCommand({ | |
| let stats = await runWebpack(true, config, showStats); | ||
| showStats(stats); | ||
| } | ||
| }) | ||
| }); | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -6,7 +6,14 @@ module.exports.pitch = function(remainingRequest) { | |
| this.cacheable && this.cacheable(); | ||
| var query = loaderUtils.getOptions(this) || {}; | ||
| var routeName = typeof query.name === 'function' ? query.name(this.resourcePath) : null; | ||
| var name = routeName !== null ? routeName : ('name' in query ? query.name : (query.formatName || String)(this.resourcePath)); | ||
|
Member
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. I knew someone would undo this |
||
| var name; | ||
| if (routeName !== null) { | ||
| name = routeName; | ||
| } else if ('name' in query) { | ||
| name = query.name; | ||
| } else if ('formatName' in query) { | ||
| name = query.formatName(this.resourcePath); | ||
| } | ||
|
|
||
| return ` | ||
| import async from ${JSON.stringify(path.resolve(__dirname, '../components/async'))}; | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -28,4 +28,4 @@ export default (env, options={}) => ({ | |
| import: 'h' | ||
| }] | ||
| ] | ||
| }) | ||
| }); | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -36,4 +36,4 @@ module.exports = class PushManifestPlugin { | |
| callback(); | ||
| }); | ||
| } | ||
| } | ||
| }; | ||
This file contains hidden or 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
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.
@developit I took the liberty of adding those rules to eslint - please check if they're ok with you.
Semicolons are enforced (they were placed almost everywhere and not enforced) & spaces should be placed after keyword (no changes to files).
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.
both good with me, thanks a bunch!