You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since last year there's a new Gradle API for registering tasks called the 'Configuration Avoidance API'. This API was incubating from Gradle 4.9 to Gradle 5.1 inclusively, but since 5.0 has been quite stable.
This API basically lets us defined tasks configuration lazily so that they are configured only if needed. While a tasks.create("myEagerTask") would always launch myEagerTask configuration, a tasks.register("myLazyTask) would configure it only if necessary. For instance launching the simple ./gradlew help would configure myEagerTask even though they are not related, but will not configure myLazyTask. Similarly, launching ./gradlew myLazyTask will configure myLazyTask and myEagerTask.
The nodeplugin configures all tasks eagerly. Their configurations does not take too much time (a ./gradlew help --scan shows they are configured in 0.4sec), but little by little, by using other plugins that aren't using this new API, we end up with several unnecessary tasks configured eagerly. It is also worth noting that the create API will one day be deprecated.
Since this API is only usable after Gradle 4.9, using it might bring breaking changes to the users. I don't see a minimum version recommendation for the node plugin, so before proposing a PR I wanted to discuss a bit about it.
I see two solutions:
Only configure lazily if the user is using Gradle >4.9
Always configure lazily but setting the minimum Gradle version to 4.9. This is my preferred solution since Gradle 6 is coming pretty soon
The text was updated successfully, but these errors were encountered:
oh that's good to know, thanks for the heads up ! Seems like there's already some work in progress for using the configuration avoidance API. I'll keep this issue open just in case though.
Since last year there's a new Gradle API for registering tasks called the 'Configuration Avoidance API'. This API was incubating from Gradle 4.9 to Gradle 5.1 inclusively, but since 5.0 has been quite stable.
This API basically lets us defined tasks configuration lazily so that they are configured only if needed. While a tasks.create("myEagerTask") would always launch myEagerTask configuration, a tasks.register("myLazyTask) would configure it only if necessary. For instance launching the simple ./gradlew help would configure myEagerTask even though they are not related, but will not configure myLazyTask. Similarly, launching ./gradlew myLazyTask will configure myLazyTask and myEagerTask.
The nodeplugin configures all tasks eagerly. Their configurations does not take too much time (a ./gradlew help --scan shows they are configured in 0.4sec), but little by little, by using other plugins that aren't using this new API, we end up with several unnecessary tasks configured eagerly. It is also worth noting that the create API will one day be deprecated.
Since this API is only usable after Gradle 4.9, using it might bring breaking changes to the users. I don't see a minimum version recommendation for the node plugin, so before proposing a PR I wanted to discuss a bit about it.
I see two solutions:
The text was updated successfully, but these errors were encountered: