Skip to content

Commit

Permalink
Limit how many fake literal string creator methods we output (fixes S…
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg authored Feb 27, 2021
1 parent 6e0ce6a commit 6de2dc9
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ object FakeLiterals {
if (collected.isEmpty) None
else {
val members =
collected.flatMap {
case (underlying: ExprTree.Lit, name) =>
collected.zipWithIndex.flatMap {
case ((underlying: ExprTree.Lit, name), idx) =>
val codePath = tree.codePath + moduleName + name
val `trait` =
ClassTree(
Expand All @@ -69,7 +69,7 @@ object FakeLiterals {
codePath,
)

val `def` =
def `def` =
MethodTree(
IArray(Annotation.Inline),
ProtectionLevel.Default,
Expand All @@ -83,7 +83,10 @@ object FakeLiterals {
codePath,
isImplicit = false,
)
List(`trait`, `def`)

// for instance @expo/vector-icons has 11500 different literal strings,
// and it causes: Class too large: typings/expoVectorIcons/expoVectorIconsStrings
if (idx <= 10000) List(`trait`, `def`) else List(`trait`)
}

Some(
Expand Down

0 comments on commit 6de2dc9

Please sign in to comment.