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

Use d2js instead of requiring d2 installed #36

Open
awhitford opened this issue Jan 1, 2025 · 2 comments
Open

Use d2js instead of requiring d2 installed #36

awhitford opened this issue Jan 1, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@awhitford
Copy link

Is your feature request related to a problem?

We need to have d2 installed (when skipGeneration is false), but of course it isn't when you are building with GitHub Actions, Netlify, or Vercel.

Mermaid doesn't have this issue because it is a JavaScript library, so build plugins can simply declare a dependency and use it.

Describe the solution you'd like

The D2 project is working on a JavaScript wrapper: d2js.
It would be great if this plugin could simply import and use this instead of requiring d2 installed.
It will make builds easier on platforms like GitHub Actions, Netlify, and Vercel.

Describe alternatives you've considered

I thought about adding build steps to preinstall d2 but I can't apt-get install d2 (yet).
However, your advice to skipGeneration is the most realistic solution right now.

Additional Context

Admittedly, d2js is young (3 days old), but recording this request because it seems like the smartest long-term direction for a plugin like this.

Related, I was surprised to see astro-diagram has been archived, making this plugin a top choice for embedding diagrams.

@awhitford
Copy link
Author

From D2's Discord group:
image

@HiDeoo
Copy link
Owner

HiDeoo commented Jan 3, 2025

Thanks for the heads up.

This have been a topic I've been following closely and I've mentioned a few times in the repository that this will be ultimately the way to go in the long run like you mentioned.

This is definitely way too early to even start experimenting with this as the package is not even available on npm yet but I'll definitely keep an eye on this and will be looking to migrate to this once it's stable enough and a feature parity with the current package can be achieved.

@HiDeoo HiDeoo added the enhancement New feature or request label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants