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

bundles the manual-edits.json file into snippet.compiled_js #523

Closed
wants to merge 0 commits into from

Conversation

Abse2001
Copy link
Contributor

@Abse2001 Abse2001 commented Jan 10, 2025

/claim tscircuit/eval#66
in this screenshot I added manual edits to the compiled code and removed any import now the manual edits file content are inside the code and does not need to be moved imported but still you need to use the manual edits prop to use it,
I want your opinion on how to handle the manual edits prop, for eg we can just define var let manualEdits and pass it down to the prop and it will be filled with the manual edit conten on compile

snippet.manual.edits.mp4

image
image
image
CC @seveibar

return {
success: true,
compiledTsx:
Babel.transform(code, {
Babel.transform(codeWithManualEdits, {
presets: ["react", "typescript"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use a bundle step here, and use userImports instead of taking the manualEditsFileContent? We're going to want to bundle other things in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Abse2001 , we may need to incorporate something like rollup....

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a recent "rolldown" bundler https://rolldown.rs/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Abse2001 it is possible that if we support web standards properly, we could support browser-native dynamic import and not need to bundle anything. However, this is a bit complex and I'll need to take some time to understand the browser specifications for dynamically importing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm investigating this extensively right now and want to help more... here's the doc on how to run rollup in the browser https://rollupjs.org/faqs/#how-do-i-run-rollup-itself-in-a-browser

I'm trying to figure out if we can somehow build to a format that's a bit easier to work with, but it's very tricky to say the least...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants