Skip to content

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

Closed
wants to merge 21 commits into from

Conversation

coolreader18
Copy link
Member

@coolreader18 coolreader18 commented Dec 23, 2018

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 from fn(..) -> PyResult to Box<(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 to index.js, and index.js to main.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 in vm/src/pyobject.rs.

@coolreader18 coolreader18 changed the title Genericize the wasm API to not specifically be for the demo site, add a small example of how to use that library, and add codemirror to the demo site. Give wasm a proper API, add a small example of how to use that library, and add codemirror to the demo site. Dec 23, 2018
@windelbouwman
Copy link
Contributor

Please resolve conflicts with this branch first. It seems like the some files are added again. For example the dict.py file.

@coolreader18
Copy link
Member Author

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.

@coolreader18
Copy link
Member Author

I'm working on closures now.

@coolreader18
Copy link
Member Author

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!

@windelbouwman
Copy link
Contributor

@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?

@coolreader18
Copy link
Member Author

Alright, sounds good.

@coolreader18
Copy link
Member Author

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 Fn(..) -> .. name until then.

@coolreader18
Copy link
Member Author

@windelbouwman should I just rebase it all onto one commit and make a PR with that?

@coolreader18
Copy link
Member Author

Alright, now moved to #245.

@windelbouwman
Copy link
Contributor

@windelbouwman should I just rebase it all onto one commit and make a PR with that?

Yes, that would be good, but I only see your message while it is too late ;)

@coolreader18 coolreader18 deleted the split-demo branch December 29, 2018 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants