Skip to content
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

Limit how many fake literal string creator methods we output #260

Merged
merged 1 commit into from
Feb 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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