-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
21 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
seskar/seskar-gradle-plugin/src/main/kotlin/seskar/gradle/plugin/LazyItemData.kt
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 @@ | ||
package seskar.gradle.plugin | ||
|
||
import seskar.gradle.plugin.Modules.ORIGINAL_MODULE_SUFFIX | ||
|
||
data class LazyItemData( | ||
val name: String, | ||
val originalFilePath: String, | ||
val type: LazyItemType, | ||
val export: String, | ||
) | ||
|
||
fun LazyItemData( | ||
export: String, | ||
): LazyItemData { | ||
val fileName = export | ||
.removePrefix("get_") | ||
.substringBefore("__react__component") | ||
|
||
return LazyItemData( | ||
name = fileName, | ||
originalFilePath = "./$fileName$ORIGINAL_MODULE_SUFFIX", | ||
type = LazyItemType.LAZY_REACT_COMPONENT, | ||
export = export, | ||
) | ||
} |
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
8 changes: 8 additions & 0 deletions
8
seskar/seskar-gradle-plugin/src/main/kotlin/seskar/gradle/plugin/LazyItemType.kt
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,8 @@ | ||
package seskar.gradle.plugin | ||
|
||
enum class LazyItemType { | ||
LAZY_FUNCTION, | ||
LAZY_REACT_COMPONENT, | ||
|
||
; | ||
} |
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
23 changes: 10 additions & 13 deletions
23
...ar/seskar-gradle-plugin/src/main/kotlin/seskar/gradle/plugin/ReactLazyComponentFactory.kt
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