Skip to content

Commit

Permalink
Updating Wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Nov 8, 2024
1 parent 1650e69 commit 2755515
Show file tree
Hide file tree
Showing 11 changed files with 409 additions and 378 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ build/

local.properties

Pods
Pods
.kotlin/metadata/
samples/sample/.kotlin/metadata/
8 changes: 4 additions & 4 deletions convention-plugins/src/main/kotlin/wasm-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

Expand Down Expand Up @@ -42,7 +42,7 @@ kotlin {
group("jsAndWasmJs") {
withJs()
if (wasmEnabled) {
withWasm()
withWasmJs()
}
}
}
Expand All @@ -51,7 +51,7 @@ kotlin {

if (project.findProperty("enableWasm") == "true") {
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
version = "21.0.0-v8-canary202309143a48826a08"
downloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minSdk = "21"
compileSdk = "34"

# Dependencies
kotlin = "1.9.22"
kotlin = "2.0.21"
binaryCompatability = "0.13.2"

androidx-core = "1.12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ internal interface ConsoleIntf {
fun log(output: String)
}

internal expect object ConsoleActual : ConsoleIntf
internal expect object ConsoleActual : ConsoleIntf {
override fun error(output: String)
override fun warn(output: String)
override fun info(output: String)
override fun log(output: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
package co.touchlab.kermit

internal actual object ConsoleActual : ConsoleIntf {
override fun error(output: String) {
actual override fun error(output: String) {
console.error(output)
}

override fun warn(output: String) {
actual override fun warn(output: String) {
console.warn(output)
}

override fun info(output: String) {
actual override fun info(output: String) {
console.info(output)
}

override fun log(output: String) {
actual override fun log(output: String) {
console.log(output)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ external fun consoleInfo(output: String)
external fun consoleLog(output: String)

internal actual object ConsoleActual : ConsoleIntf {
override fun error(output: String) {
actual override fun error(output: String) {
consoleError(output)
}

override fun warn(output: String) {
actual override fun warn(output: String) {
consoleWarn(output)
}

override fun info(output: String) {
actual override fun info(output: String) {
consoleInfo(output)
}

override fun log(output: String) {
actual override fun log(output: String) {
consoleLog(output)
}
}
744 changes: 382 additions & 362 deletions samples/sample/kotlin-js-store/yarn.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions samples/sample/shared/shared.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Pod::Spec.new do |spec|
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
end

spec.xcconfig = {
'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
}

spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':shared',
'PRODUCT_MODULE_NAME' => 'shared',
Expand Down
2 changes: 1 addition & 1 deletion samples/sample/wasm-browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A simple app showing Kermit calls directly and through a shared module.

Check out the repo, navigate to the project folder, and use the following command:
```
./gradlew :wasm-browser:wasmBrowserRun
./gradlew :wasm-browser:wasmJsBrowserRun
```

## Setup Environment
Expand Down

0 comments on commit 2755515

Please sign in to comment.