-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(loadable-components): Transpile
lazy
and signatures configurat…
…ion (#242) closes #241 This pull request brings behavior closer to babel plugin: 1. Add ability to transpile `lazy` from `@loadable/component` without hacks 2. Add ability to configure signatures. [babel plugin doc](gregberge/loadable-components@edaf30c) **BREAKING CHANGE:** Before this changes plugin detected loadable only by `loadable` keyword. After you should to configure `signatures` if you are using imports non from `@loadable/component`. For example: ``` ["loadable-components", { "signatures": [ { "from": "myLoadableWrapper", "name": "default" }, { "from": "myLoadableWrapper", "name": "lazy" }] }] ```
- Loading branch information
Showing
51 changed files
with
466 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
1 change: 1 addition & 0 deletions
1
...able-components/tests/fixture/aggressive import/should work with destructuration/input.js
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
import loadable from "@loadable/component"; | ||
loadable(({ foo }) => import(/* webpackChunkName: "Pages" */ `./${foo}`)); |
1 change: 1 addition & 0 deletions
1
...ble-components/tests/fixture/aggressive import/should work with destructuration/output.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import loadable from "@loadable/component"; | ||
loadable({ | ||
resolved: {}, | ||
chunkName ({ foo }) { | ||
|
1 change: 1 addition & 0 deletions
1
...-components/tests/fixture/aggressive import/with webpackChunkName/should keep it/input.js
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
1 change: 1 addition & 0 deletions
1
...components/tests/fixture/aggressive import/with webpackChunkName/should keep it/output.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import loadable from "@loadable/component"; | ||
loadable({ | ||
resolved: {}, | ||
chunkName (props) { | ||
|
1 change: 1 addition & 0 deletions
1
...mponents/tests/fixture/aggressive import/with webpackChunkName/should replace it/input.js
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
import loadable from "@loadable/component"; | ||
loadable((props) => import(/* webpackChunkName: "Pages" */ `./${props.foo}`)); |
1 change: 1 addition & 0 deletions
1
...ponents/tests/fixture/aggressive import/with webpackChunkName/should replace it/output.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import loadable from "@loadable/component"; | ||
loadable({ | ||
resolved: {}, | ||
chunkName (props) { | ||
|
1 change: 1 addition & 0 deletions
1
...ixture/aggressive import/without webpackChunkName/should support complex request/input.js
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
import loadable from "@loadable/component"; | ||
loadable((props) => import(`./dir/${props.foo}/test`)); |
1 change: 1 addition & 0 deletions
1
...xture/aggressive import/without webpackChunkName/should support complex request/output.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import loadable from "@loadable/component"; | ||
loadable({ | ||
resolved: {}, | ||
chunkName (props) { | ||
|
1 change: 1 addition & 0 deletions
1
.../fixture/aggressive import/without webpackChunkName/should support destructuring/input.js
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
import loadable from "@loadable/component"; | ||
loadable(({ foo }) => import(`./dir/${foo}/test`)); |
1 change: 1 addition & 0 deletions
1
...fixture/aggressive import/without webpackChunkName/should support destructuring/output.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import loadable from "@loadable/component"; | ||
loadable({ | ||
resolved: {}, | ||
chunkName ({ foo }) { | ||
|
1 change: 1 addition & 0 deletions
1
...fixture/aggressive import/without webpackChunkName/should support simple request/input.js
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
import loadable from "@loadable/component"; | ||
loadable((props) => import(`./${props.foo}`)); |
1 change: 1 addition & 0 deletions
1
...ixture/aggressive import/without webpackChunkName/should support simple request/output.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import loadable from "@loadable/component"; | ||
loadable({ | ||
resolved: {}, | ||
chunkName (props) { | ||
|
3 changes: 3 additions & 0 deletions
3
packages/loadable-components/tests/fixture/lazy/should be transpiled too/input.js
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,3 @@ | ||
import { lazy } from "@loadable/component"; | ||
|
||
lazy(() => import("./ModA")); |
Oops, something went wrong.