JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.15k stars 1.17k forks source link

webpack-dev-server npm install warnings on first run jb-compose getting started tutorial #2503

Closed bobhy closed 1 month ago

bobhy commented 1 year ago

Following instructions at https://github.com/JetBrains/compose-jb/tree/master/tutorials/Web/Getting_Started

  1. open community edition idea, create new compose project
  2. edit build.gradle.kts, change version of kotlin plugin to 1.7.20 and compose plugin to 1.2.1
  3. run build

expect: Clean build and a project ready to run

observe: many build warnings, noted below Looking at the warnings, they are run-of-the-mill deprecation warnings and probably do not block the tutorial. But it's not the easy-to-use developer experience promised by use of IntelliJ and Compose project wizard. Perhaps there's a newer version of webpack-dev-server and watchpack that would avoid the jarring experience? Audience is n00bs, such as myself. We scare easily.

3:30:13 PM: Executing ':assemble :jsMainClasses :jsTestClasses :metadataMainClasses'...

> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.

The property 'kotlin.native.enableDependencyPropagation=false' has no effect in this and future Kotlin versions, as Kotlin/Native dependency commonization is now enabled by default. It is safe to remove the property.

Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/runtime/runtime/1.2.1/runtime-1.2.1.pom, took 116 ms (2.76 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/web-core/1.2.1/web-core-1.2.1.pom, took 131 ms (2.04 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/runtime/runtime/1.2.1/runtime-1.2.1.module, took 24 ms (21.81 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/web-core/1.2.1/web-core-1.2.1.module, took 21 ms (3.15 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/web-core-js/1.2.1/web-core-js-1.2.1.pom, took 18 ms (2.76 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/web-core-js/1.2.1/web-core-js-1.2.1.module, took 23 ms (3.4 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/runtime/runtime-js/1.2.1/runtime-js-1.2.1.pom, took 19 ms (2.8 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/runtime/runtime-js/1.2.1/runtime-js-1.2.1.module, took 23 ms (3.37 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/internal-web-core-runtime/1.2.1/internal-web-core-runtime-1.2.1.pom, took 20 ms (2.06 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/internal-web-core-runtime/1.2.1/internal-web-core-runtime-1.2.1.module, took 20 ms (2.35 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/atomicfu/0.17.2/atomicfu-0.17.2.pom, took 20 ms (1.67 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.6.1/kotlinx-coroutines-core-1.6.1.pom, took 40 ms (2.06 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/atomicfu/0.17.2/atomicfu-0.17.2.module, took 22 ms (20.93 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-bom/1.6.1/kotlinx-coroutines-bom-1.6.1.pom, took 20 ms (4.29 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.6.1/kotlinx-coroutines-core-1.6.1.module, took 23 ms (22.89 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/internal-web-core-runtime-js/1.2.1/internal-web-core-runtime-js-1.2.1.pom, took 17 ms (2.32 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/internal-web-core-runtime-js/1.2.1/internal-web-core-runtime-js-1.2.1.module, took 20 ms (2.79 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-js/1.6.1/kotlinx-coroutines-core-js-1.6.1.pom, took 23 ms (2.1 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-js/1.6.1/kotlinx-coroutines-core-js-1.6.1.module, took 19 ms (5.92 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-test-js/1.7.20/kotlin-test-js-1.7.20.pom, took 62 ms (1.72 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-test-js/1.7.20/kotlin-test-js-1.7.20.module, took 91 ms (2.07 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/web-core-js/1.2.1/web-core-js-1.2.1.klib, took 68 ms (483.15 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/web/internal-web-core-runtime-js/1.2.1/internal-web-core-runtime-js-1.2.1.klib, took 28 ms (20.26 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/runtime/runtime-js/1.2.1/runtime-js-1.2.1.klib, took 126 ms (1.09 MB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/atomicfu-js/0.17.2/atomicfu-js-0.17.2.klib, took 142 ms (33 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-js/1.6.1/kotlinx-coroutines-core-js-1.6.1.klib, took 31 ms (777.41 kB)
Default webpack version now is 5. Support of webpack 4 is deprecated.
Download https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-test-js/1.7.20/kotlin-test-js-1.7.20.jar, took 38 ms (107.13 kB)

> Task :transformCommonMainDependenciesMetadata
> Task :compileCommonMainKotlinMetadata SKIPPED
> Task :generateProjectStructureMetadata
> Task :metadataCommonMainClasses UP-TO-DATE
> Task :allMetadataJar
> Task :jsProcessResources
> Task :jsBrowserProductionExecutableDistributeResources
> Task :kotlinNpmCachesSetup
> Task :jsPackageJson
> Task :kotlinNodeJsSetup
> Task :kotlinRestoreYarnLock SKIPPED
> Task :kotlinYarnSetup
> Task :jsTestPackageJson
> Task :packageJsonUmbrella
> Task :rootPackageJson

> Task :kotlinNpmInstall
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > webpack-log > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning "workspace-aggregator-383690c4-6e0e-46fb-bdd5-caddc2a0acf8 > compose-gettingStarted-test > karma-webpack@5.0.0" has incorrect peer dependency "webpack@^5.0.0".
warning Ignored scripts due to flag.

> Task :jsGenerateExternalsIntegrated SKIPPED
> Task :kotlinStoreYarnLock
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/compiler/compiler/1.3.2.1/compiler-1.3.2.1.pom, took 71 ms (1.77 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/compiler/compiler/1.3.2.1/compiler-1.3.2.1.module, took 18 ms (2.69 kB)
Download https://repo.maven.apache.org/maven2/org/jetbrains/compose/compiler/compiler/1.3.2.1/compiler-1.3.2.1.jar, took 104 ms (963.75 kB)
> Task :jsPublicPackageJson
> Task :jsSourcesJar
> Task :jsTestProcessResources NO-SOURCE
> Task :compileKotlinMetadata SKIPPED
> Task :metadataMainClasses UP-TO-DATE
> Task :compileKotlinJs
> Task :jsMainClasses
> Task :jsJar
> Task :compileTestKotlinJs NO-SOURCE
> Task :jsTestClasses UP-TO-DATE
> Task :compileProductionExecutableKotlinJs
> Task :jsProductionExecutableCompileSync
> Task :jsBrowserProductionWebpack
> Task :jsBrowserDistribution
> Task :assemble

BUILD SUCCESSFUL in 2m 34s
20 actionable tasks: 20 executed
3:32:48 PM: Execution finished ':assemble :jsMainClasses :jsTestClasses :metadataMainClasses'.
bobhy commented 1 year ago

Followup: if the root of this problem is the use of Webpack 4 when it could/should be v5, where do I specify this? I cannot find a dependency version of webpack being specified anywhere in the project?

dima-avdeev-jb commented 1 year ago

@bobhy Webpack can be configured with file gradle.properties kotlin.js.webpack.major.version=4

dima-avdeev-jb commented 1 year ago

@bobhy I see gradle output BUILD SUCCESSFUL Has your project started successfully?

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.