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

(Example) Expose routes library in playground #178

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jchavarri
Copy link
Member

@jchavarri jchavarri commented Apr 23, 2024

This is just a small example based on a Twitter convo with @ManasJayanth about exposing "regular" OCaml libraries in the playground.

The changes required are the following:

  • The libraries added need to be compatible with Melange. See the related PR in routes repo: Support melange anuragsoni/routes#151
  • Add the package to the doc site opam file
  • Add the libraries to the playground melange.emit stanza. This makes sure that the generated JS files will be available in node_modules for bundling
  • Add a Dune rule to generate the cmijs from the library so they can be compiled "live" in the playground. Add this cmijs.js file to both the playground-assets and the app.jsx entry point so they get loaded in the browser.

And a screen capture:

image

@ManasJayanth
Copy link

I fed this PR to ChatGPT and asked it to create instructions for new contributors. Does it look useful?

https://chat.openai.com/share/860d8e97-3055-458e-9c22-10f7b7c1b8e8

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