-
Notifications
You must be signed in to change notification settings - Fork 45
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
Predictable module names (fixes #469) #485
Conversation
6c2d592
to
b15041b
Compare
b15041b
to
e91b838
Compare
One possible problem is that this might trigger windows long file name errors, those were somewhat common in the past. I think if that happens let's rather compress the file names on windows and keep the package names correct. |
add `stShortModuleNames` (for sbt plugin) and `--shortModuleNames` for CLI which reverts to old behaviour. Note that the old behaviour is deprecated
e91b838
to
317b19f
Compare
With class files the packages will always correspond to directories so not sure that is an option |
@nafg to gauge the problem I wrote a script to traverse all the jar files for a full CI build, looking for the longest class files. The longest is a trait produced from the fake string literals:
This will blow up the windows path budget in any case, weighing in at 274 chars. On the bright side, this should be gone after #487, so let's dig up the longest class class file name after removing those of fake strings:
214 chars. Will very likely fail on windows, given that there is a semi-long prefix added to this. If we change the naming pattern for the builder class, it could come out like this instead:
That's 171 chars. borderline possible to compile on windows. |
Then there are anonymous traits, object types not named in TS.
260 chars. may also want to enforce length of these traits, without introducing name collisions. I thought that was already in place honestly, but there's probably a bug in that code |
…o not have a name. This is a follow-up from #485, to avoid too long class names on windows
…o not have a name. This is a follow-up from #485, to avoid too long class names on windows
…Builder`. It should be fine, since they are always nested within the companion object, and they should not be named anyway in user code. This only applies to scala 2.x, these are rewritten to `extension` for scala 3. This is a follow-up from #485, to avoid too long class names on windows
…o not have a name. This is a follow-up from #485, to avoid too long class names on windows
…Builder`. It should be fine, since they are always nested within the companion object, and they should not be named anyway in user code. This only applies to scala 2.x, these are rewritten to `extension` for scala 3. This is a follow-up from #485, to avoid too long class names on windows
Thanks, @oyvindberg for pointing out where the changes come from. |
Problem
It's almost impossible to map Javascript module names to the currently generated ST object/package names in your head.
There is a 1-1 correspondence, but it's impossible to understand. Let's finally fix this mistake!
I know this will lead to "uglier"/longer module names, this has been discussed various times in the past, but the encoding needs to become easier to understand.
Keep old behavior
add
stShortModuleNames
(for sbt plugin) and--shortModuleNames
for CLI which reverts to old behaviour.Note that this old behaviour is deprecated. I don't intend to remove it for a long while, but I won't put any effort into maintaining it either.
Example
Here is a typical example of what it'll look like - see how clearly you can see the hierarchy even though it's flattened.