-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Enable JS IR backend #1832
Enable JS IR backend #1832
Conversation
b26e921
to
e961eb1
Compare
} | ||
|
||
sourceSets { | ||
jsMain.dependencies { | ||
api "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" | ||
api "org.jetbrains.kotlinx:atomicfu-js:$atomicfu_version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependency should be conditional and present only for IR backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be hard to enable it conditionally in this build script. @ilgonmic could you help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that it should be not dependency in js source set but specific ir target compilation
js().irTarget?.compilations['main']?.dependencies {
api "org.jetbrains.kotlinx:atomicfu-js:$atomicfu_version"
}
|
||
if (project.tasks.findByName('compileKotlinJsIr')) { | ||
compileKotlinJsIr { | ||
kotlinOptions.freeCompilerArgs += "-XXLanguage:-NewInference" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate why NI is disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question regarding atomicfu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted. It used to fail but now new inference is fixed for JS IR and disabled for classic backend.
js/example-frontend-js/build.gradle
Outdated
@@ -5,6 +5,24 @@ | |||
apply plugin: 'kotlin-dce-js' | |||
apply from: rootProject.file('gradle/node-js.gradle') | |||
|
|||
// Workaround resolving new Gradle metadata with kotlin2js | |||
// TODO: Remove once plugin is fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and how do we know that the plugin is fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue
|
||
if (project.tasks.findByName('compileKotlinJsIr')) { | ||
compileKotlinJsIr { | ||
kotlinOptions.freeCompilerArgs += "-XXLanguage:-NewInference" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question regarding atomicfu
// disable metadata everywhere, but in native modules | ||
if (type == 'maven' || type == 'metadata' || type == 'jvm' || type == 'js') { | ||
// disable metadata everywhere, but in native and js modules | ||
if (type == 'maven' || type == 'metadata' || type == 'jvm') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it going to break our releases with Kotlin 1.3.70? Do we really have to publish metadata if IR BE is not here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really have to publish metadata if IR BE is not here?
We don't
Isn't it going to break our releases with Kotlin 1.3.70?
I assumed adding metadata wouldn't break stuff. @ilgonmic please take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Gradle 5.3 it can consume metadata for dependency from repo. So for this version range it should not break release.
But this check can be covered with plus one check on 1.4 release, and not publish metadata for 1.3.70 releases
82112d6
to
0b98fd4
Compare
4a49830
to
aff8202
Compare
* Enable JS IR backend * Workaround resolving Gradle metadata in kotlin2js plugin Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
No description provided.