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

Accept Uint8Array as file code input #769

Open
2 tasks done
izznat opened this issue Feb 26, 2023 · 2 comments
Open
2 tasks done

Accept Uint8Array as file code input #769

izznat opened this issue Feb 26, 2023 · 2 comments

Comments

@izznat
Copy link

izznat commented Feb 26, 2023

Tell us how you think we can improve Sandpack

Packages affected

  • sandpack-client
  • sandpack-react

What is this feature?

nodebox accepts both string and Uint8Array to initialize its file system. Change sandpack-client and sandpack-react API to support it too.

This is useful to make sandpack as closely as possible to local development setup. For example to include static files in public directory directly inside nodebox such as gltf object for three.js.

How would your idea work?

Pass in files to SandpackProvider in either string or Uint8Array format.

Do you have any examples of how you would like to see us implement it?

Change the types and pass the files as is for nodebox runtime and either convert Uint8Array to utf-8 string or throw error for non-nodebox runtime.

@izznat izznat added feature:request triage New issues that needs consideration labels Feb 26, 2023
@izznat
Copy link
Author

izznat commented Feb 26, 2023

I'll try to submit a PR.

@danilowoz danilowoz removed the triage New issues that needs consideration label Feb 27, 2023
@danilowoz
Copy link
Member

This is a valid point, and I would love to have it on Sandpack. I have added your feature request to our internal backlog, which we use to prioritize what to build next. We can't make any promises about the timing, but it's on the list! If you'd like to work on this feature with us, please create a pull request, and we'll help you along the way.

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

No branches or pull requests

2 participants