-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rethink how JavaScript packages are generated #176
Comments
Hey @locriacyber 👋 Thanks for taking an interest in ditto!
This was a deliberate design choice, as I wanted ditto packages to be able to express NPM dependencies. See https://github.com/ditto-lang/vdom/blob/702d6e4c1bb711b11ca6a0bc3bafc19d8fdfdb3c/ditto.toml#L10-L11 for example: the
This is, in effect, what PureScript does. And it has this issue where NPM dependencies are implicit. In cases like Re serving generated files directly to the browser: I had imagined ditto code would always be passed through a bundler, but this would be a nice thing to support. I don't think it would work given the presence of NPM dependencies though? And WRT Deno: I plan to support this as a separate codegen target in the future, bear with me. |
In Deno, you can import npm modules with |
See ditto-lang/todomvc#3. It doesn't work with pnpm. |
Also, do you have other community channels, like Matrix? I'm interested in talking to you about ditto. |
Sweet, good to know 🙏 But like I say, the current JavaScript code generator isn't intended to be deno compatible. My plan was to introduce a new target for deno (#15 (comment))
Yeah that's a good point. The root I might need to rethink how the ditto/crates/ditto-make/src/compile.rs Lines 346 to 375 in 2060206
There's no community at the moment 😅 Would just be me in the channel... If you wanted to set something up I'd be grateful. Although I have a slight preference for using discussions. |
Currently, JS files produced by Ditto rely on npm for linking. The reason in that they import each other with
import
std/...`.It might be better to generate both
packages
anddist
in the some folder, and use relative imports. This way, these files can be served directly to be used in browser, or in Deno.The text was updated successfully, but these errors were encountered: