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

Run extract-client-components as an esbuild plugin #199

Merged
merged 14 commits into from
Jan 20, 2025

Conversation

davesnx
Copy link
Member

@davesnx davesnx commented Jan 17, 2025

No description provided.

let current_dir = Sys.getcwd () in
let melange_target = Filename.concat current_dir target in
match capture_all_client_component_files_in_target melange_target with
| Ok manifest ->
render_manifest ~path manifest;
print_endline (render_manifest manifest);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to print it?

Copy link
Member Author

Choose a reason for hiding this comment

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

we print to the stdout so I can use the CLI from both:

  • dune (with-stdout-to (cli))
  • esbuild const content = execSync("cli"); Fs.writeFile(...)

Before the cli was writing the file, so from the outside had less control. That could be configured by a parameter, but the stdout should probably be the default

Copy link
Collaborator

@pedrobslisboa pedrobslisboa left a comment

Choose a reason for hiding this comment

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

The more I see it, the more I get excited to see the final demo. Great work man ❤️ 🎉

@davesnx davesnx force-pushed the run-extract-as-esbuild-plugin branch from bbccbcc to 54ee294 Compare January 20, 2025 12:24
@davesnx davesnx merged commit 346fd3e into main Jan 20, 2025
2 checks passed
@davesnx davesnx deleted the run-extract-as-esbuild-plugin branch January 20, 2025 12:44
davesnx added a commit that referenced this pull request Jan 21, 2025
… into fix-render-to-lwt-stream

* 'main' of github.com:ml-in-barcelona/server-reason-react:
  Run extract-client-components as an esbuild plugin (#199)
davesnx added a commit that referenced this pull request Jan 21, 2025
… into fix-render-to-lwt-stream

* 'main' of github.com:ml-in-barcelona/server-reason-react:
  Run extract-client-components as an esbuild plugin (#199)
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