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

Is there a plan to provide typescript binding? #18

Open
Roy-Kid opened this issue Jan 24, 2023 · 6 comments
Open

Is there a plan to provide typescript binding? #18

Roy-Kid opened this issue Jan 24, 2023 · 6 comments

Comments

@Roy-Kid
Copy link

Roy-Kid commented Jan 24, 2023

I want to use chem files in js/ts. Is there any possible that use wasm-binding to bind rust chemfiles with ts?

@Luthaf
Copy link
Member

Luthaf commented Jan 24, 2023

There is a work in progress version here: https://github.com/chemfiles/chemfiles.js/. This is directly compiling C++ to WASM, and calling it from JS, not using Rust's binding to chemfiles at all.

There are a couple of rough edges around handling files in the browser, and documentation would be very sparse, but it should be working.

@Roy-Kid
Copy link
Author

Roy-Kid commented Jan 25, 2023

Thanks a lot! That is what I really want. I will have a try!

@Roy-Kid Roy-Kid closed this as completed Jan 25, 2023
@Roy-Kid Roy-Kid reopened this Jan 26, 2023
@Roy-Kid
Copy link
Author

Roy-Kid commented Jan 26, 2023

Hi, I am so sorry to bother you. I tried every possible way to introduce chemfiles into my typescript project, but always failed. The last error is

Uncaught TypeError: Cannot read properties of undefined (reading 'stackSave')
    at stackAutoclean (stack.ts:32:31)
    at new Trajectory (trajectory.ts:64:46)
    at load_traj (load.js?16d2:6:1)
    at MolvisScene.load_traj (scene.js?c4e4:40:1)
    at eval (index.js?b635:37:1)
    at ./src/index.js (bundle.js:10133:1)
    at __webpack_require__ (bundle.js:10162:33)
    at bundle.js:11234:37
    at bundle.js:11236:12

Could you kindly release a very preview version of npm package so I can use it in my project?

@Luthaf
Copy link
Member

Luthaf commented Jan 26, 2023

Right, I suspected something like this might happen, I haven't touched this project for a while. I'll try to give this a go ASAP, but I'll be away from a keyboard for the next month, so it might take some time.

@Roy-Kid
Copy link
Author

Roy-Kid commented Jan 26, 2023

Thanks! Enjoy your vacation!

@Luthaf Luthaf transferred this issue from chemfiles/chemfiles Mar 23, 2023
@Luthaf
Copy link
Member

Luthaf commented Mar 23, 2023

So I moved the issue to chemfiles.js, and took some time to update all dependencies. How are you trying to use chemfiles? Inside a webpack project? If you have some sample project I can use to reproduce the issue, it would be nice.

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

No branches or pull requests

2 participants