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

Add support for WASM compilation #222

Merged
merged 5 commits into from Jun 14, 2022
Merged

Add support for WASM compilation #222

merged 5 commits into from Jun 14, 2022

Conversation

benwis
Copy link
Contributor

@benwis benwis commented Jun 8, 2022

I wanted to use comrak on the web, and I needed a couple small tweaks to compile to WASM.

Mostly I needed to modify the dependencies to reduce the number of features for syntect, as regex-onig is not portable. Also, there's no way to have a default config file in WASM.

I am not using most of the features of comrak, so I am really not sure what depends on syntect's features, but compiling markdown to syntax highlighted HTML is working with these changes.

@kivikakk
Copy link
Owner

Hey there; thanks so much for this! I'm happy to accept these changes, but I'd like a CI job that compiles to wasm like you do so I can be sure not to break this in the future by accident.

I'm super unfamiliar, and my attempt I've pushed to your PR branch in f06c360 doesn't actually compile — see the build log. Would you be able to adjust it so it reflects how you do this? Thanks! 😊

@benwis
Copy link
Contributor Author

benwis commented Jun 11, 2022

Ah, there's nothing wrong with your action. But you need Cargo's better cfg feature resolver to actually stop it from trying to import onig in this condition. Alternatively you could update to the 2021 edition

@kivikakk kivikakk merged commit 7baa12f into kivikakk:main Jun 14, 2022
@kivikakk
Copy link
Owner

Finally got there! Let me know if you want a release or anything.

@benwis
Copy link
Contributor Author

benwis commented Jun 15, 2022

Would love a release, thanks for finding the issue. Guess propfuzz doesn't like it either

@SpanishPear
Copy link

Would also love a release for this!

@kivikakk
Copy link
Owner

These are now available in 0.13.1.

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.

None yet

3 participants