-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add Wasm support #510
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Hey! This is definitely on the roadmap! I still couldn't get to it yet. I highly appreciate contributions regards supporting WASM. I don't think |
Ah yea, I think libgit2 can be compiled to Wasm but it's gonna be quite sizeable. For a Wasm target I could imagine just relying on host functionality to spawn git commands, e.g., via |
Oh, forgot to mention, one other thing that we can do is to disable the |
Ohhh, that's a good idea at least to start with. We could then add more features as we go! I love it. |
Yup! Are you interested in trying that out? There might be other wasm-related issues with other crates but I think it is worth a shot. |
I can see if I find some time but I can't promise anything. My schedule is pretty busy at the moment. But if you decide to take a stab and have questions, let me know. Happy to help. |
I tried to compile Intuitively, first thing that I tried was slapping rustup target add wasm32-unknown-unknown
cargo build -p git-cliff-core --no-default-features --target wasm32-unknown-unknown
It turns out [dependencies.tera]
version = "1.19.1"
default-features = false
features = ["urlencode", "slug", "humansize", "chrono", "chrono-tz"] That works! Okay, now how do we use it? I found this tutorial and it refers to
Ugh, it tries to pull in [features]
default = [] It also made me add the following to [lib]
crate-type = ["cdylib", "rlib"]
Yay! Then I initialized the actual web project:
Added the "dependencies": {
"git-cliff": "file:../pkg"
},
"devDependencies": {
"hello-wasm-pack": "^0.1.0",
"webpack": "^4.29.3",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.5",
"copy-webpack-plugin": "^5.0.0",
"git-cliff": "file:../pkg"
} Update import * as git_cliff from "git-cliff"; Run the app (I had to set
I don't know what happened there. Also, all the js and WASM files under pkg seems weird, I don't know if I should expect to see any Anyways, that was my attempt. Let me know if you find something / if I'm on the correct path. |
👋 First of all, great project!
I was wondering if we can add a wasm-wasi target so folks could use this in WebContainer as well which can't run native binaries.
I was thinking for those that install this via npm, we could add another optional dependencies for
cpu=wasm32
which would be installed in WebContainer and then people could use this to generate their changelogs.What do you think?
The text was updated successfully, but these errors were encountered: