Skip to content
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

Support WASM target #54

Open
cjbrooks12 opened this issue Oct 2, 2023 · 7 comments
Open

Support WASM target #54

cjbrooks12 opened this issue Oct 2, 2023 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@cjbrooks12
Copy link
Member

Create a version of Ballast that supports WASM targets. It will likely need to wait until all of its libraries also support WASM (coroutines, serialization, UUID, etc.) or only develop this on another branch and only release the modules which don't have any external dependencies other than Coroutines.

@cjbrooks12 cjbrooks12 added hacktoberfest Help is wanted for Hacktoberfest help wanted Extra attention is needed and removed hacktoberfest Help is wanted for Hacktoberfest labels Oct 2, 2023
@charlee-dev
Copy link
Contributor

Yeah, this one would be nice. I wanted to try WASM in my biggish project and noticed that ballast I blocking me... Will see how much effort adding the wasm will take. 🤞

@charlee-dev
Copy link
Contributor

charlee-dev commented Jan 25, 2024

question by applying applyDefaultHierarchyTemplate() Gradle generates sourceSets based on targets we applied. This lets me make this change:

Old

kotlin {    
    val subprojectInfo = ConventionConfig.subprojectInfo(project)

    sourceSets {
        if (subprojectInfo.kotlinJs) {
            val jsTest by getting {
                 dependencies { }
            }
        }

        // more sourceSets
     }
}

New

kotlin {
    applyDefaultHierarchyTemplate()
    
    val subprojectInfo = ConventionConfig.subprojectInfo(project)

    sourceSets {
        if (subprojectInfo.kotlinJs) {
            jsTest.dependencies { }
        }

        // more sourceSets
     }
}

But having jsTest.dependencies { } is not needed at all, because applyDefaultHierarchyTemplate() will create a placeholder for it.

So the question is, Do you prefer to keep those empty or clean them up? I would prefer the cleanup. Less code less to maintain and less bugs.

@cjbrooks12
Copy link
Member Author

I'd prefer to keep them there. It has helped me identify issues in the past with typos in the sourcesets or wrong configurations, so I use it as a bit of a check to make sure things are set up correctly.

@cjbrooks12
Copy link
Member Author

Yeah, this one would be nice. I wanted to try WASM in my biggish project and noticed that ballast I blocking me... Will see how much effort adding the wasm will take. 🤞

I, myself, have been blocked by Kotest with WASM support. There's a few other libraries that might also need to be updated (or replaced) before Ballast can be updated, but I hadn't even gotten that far into looking into it. I initially started working to get WASM included in the next Ballast release, but when I realized there's still a bit of work to be done and some dependencies/plugins that may need workarounds or to be disabled, I decided to hold off and release Ballast 4.1 with the Scheduler first, and then come back to it shortly afterward.

@rjaros
Copy link

rjaros commented May 9, 2024

Kotest 5.9.0 with Wasm support was just released.

@cjbrooks12
Copy link
Member Author

Yes, I was so excited to see that drop yesterday! I've already started getting Ballast updated with it, planning to do a lot of work on it over the weekend, and hopefully I can get WASM support released very soon.

@cjbrooks12
Copy link
Member Author

Good news, initial results are very promising. ballast-core compiles to wasmJs and all tests are passing with no code modifications. I've yet to try including it in a Compose WASM app, but from the ease of these initial updates, I'm hopeful that I will be able to get this published very soon.

The wasmWasi target cannot be supported yet because kotlinx.coroutines doesn't yet support it either: Kotlin/kotlinx.coroutines#4064.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants