-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Give wasm a proper API, add a small example of how to use that library, and add codemirror to the demo site. #238
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
Conversation
Please resolve conflicts with this branch first. It seems like the some files are added again. For example the dict.py file. |
This included changing RustObjectKind::RustFunction.function to be a `Box<Fn()>` instead of a `fn()` to support closures.
e05465e
to
ab23f2c
Compare
I think those files are conflicting because there are some changes to them that I made near the end of the previous PR that I didn't pull into this branch, but all the changes that were made are there, just moved around. I'm pretty sure I just copy-pasted them. |
I'm working on closures now. |
…l/wasm-pack-plugin Also change travis deploy to use new demo directory.
Okay, those conflicting files are annoying and are preventing travis builds from running, so I'll just leave them in the PR and once it's merged could a maintainer then remove them? I don't think there's any way to do it otherwise. Thanks! |
@coolreader18 The changes you made are good, but the git history is now pretty messy. Could you make two new pull requests? One with the change of RustPyFunc and the other one with the wasm demo page improvements? |
Alright, sounds good. |
Okay, so I actually can't have a trait alias as set up in the code due to rust-lang/rust#55687 not being merged to stable yet (I have nightly set as my default so I didn't notice it locally), so I'm just reverting to using the long |
@windelbouwman should I just rebase it all onto one commit and make a PR with that? |
Alright, now moved to #245. |
Yes, that would be good, but I only see your message while it is too late ;) |
This is what I was sorta referring to in #230. In order to be able to make rustfuncs out of closures, I needed to change
RustObjectKind::RustFunction.function
fromfn(..) -> PyResult
toBox<(Fn(..) -> PyResult)>
, but I think that will lend itself to even more interesting stuff down the line.I also did some more semantic things like renaming
bootstrap.js
toindex.js
, andindex.js
tomain.js
, and refactoring the build and release scripts a bit. LMK if this goes against the conventions for this repository.I might also add closure injection from JS to python tomorrow, but I just wanted to get this PR started.
Also, sorry for the mess of diffs with merging in changes from master, the majority of the changes are in
wasm/
with a bit relating to rust functions invm/src/pyobject.rs
.