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

fix: allow running in insecure context #1666

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Conversation

omarmir
Copy link
Contributor

@omarmir omarmir commented Feb 12, 2025

  • I read the contributing guide
  • I agree to follow the code of conduct

Summary

The current packages for inline and image blocks use crypto.randomuuid to generate UUID for useState but crypto.randomuuid is not available in non-HTTPS context. This means it cannot run in insecure context.

How did you test this change?

I ran the tests and it passed all tests (pnpm test). I also used the mono repo in my existing project and it solves the issue.

I ran the package in an insecure context and I no longer run into issues. I fixed the issue by including nanoid to generate random UUIDs instead of relying on crypto. It adds bloat but nanoid is reliable and is one of the smallest (if not the smallest) package.

Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
milkdown-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 4:30am

Copy link

nx-cloud bot commented Feb 12, 2025

View your CI Pipeline Execution ↗ for commit a8e81d1.

Command Status Duration Result
nx run-many --target=build --all --parallel ✅ Succeeded 41s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-12 07:45:28 UTC

@Saul-Mirone Saul-Mirone added this pull request to the merge queue Feb 12, 2025
Merged via the queue into Milkdown:main with commit 52ef575 Feb 12, 2025
11 checks passed
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