Replies: 4 comments 4 replies
-
|
I work with Strobe and want to make a second plea for this :-) The problem:
Instead:
Would you consider a PR for this if we make one? |
Beta Was this translation helpful? Give feedback.
-
|
Thing is, there is currently no cacheable task-type in Mill that can have parameters, unless you count a dedecated cross-module with a single task in. Looks like my proposal for parametrized tasks would be a good fit for it. |
Beta Was this translation helpful? Give feedback.
-
|
@malcolmredheron As @lefou said, we don't have cached parametrized tasks right now. Right now your options are:
PRs are great but what you're asking for would be a pretty deep and fundamental change in Mill that I wouldn't expect someone to be able to accomplish easily |
Beta Was this translation helpful? Give feedback.
-
|
Oh! We weren't thinking of anything as grand as you two are talking about :-) If ScalaJSModule.linkTask ( ) were public and we called it from our own persistent task, wouldn't that allow us to indicate whether we want a full or fast link and still get caching? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Because mill statically building task dependencies graph, conditional code like this means that both tasks will be executed before current one (if condition can't be known beforehand).
And it lot of cases is possible to deal with that by implementing something like selectTaks() which should be executed instead of that expression with conditional value known at compilation time.
That by itself fascinating issue to deal with it if for your case you can't know condition at compile time and only can get it during build like if some application returning it).
But I'd like to discuss case with ScalaJS because with it it seems easy to hit need for it while it could be avoided.
I noticed that difference between fullLinkJS, fastLinkJS it just how it pass parameters to linkTask in implementation.
mill/libs/scalajslib/src/mill/scalajslib/ScalaJSModule.scala
Line 112 in c0f5259
So if something like
linkJS(isFullLinkJS = false|true)could be added then is no need to conditionally deal with ScalaJS compilation anymore for lot of user cases. As it will be possible to pass value directly to it.Is it any other way to deal with that? I think currently is not possible to override linkTask for ScalaJSModule
see example here at branch
linker-conditions-demohttps://github.com/american-fable/demo-mill-assembly-invalidation-issue/tree/linker-conditions-demoBeta Was this translation helpful? Give feedback.
All reactions