-
Notifications
You must be signed in to change notification settings - Fork 100
WIP: chore: refactor with deno_lib #1873
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
base: next
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the codebase to use deno_lib and updates to newer versions of Deno dependencies. The changes introduce a new module loader implementation and significantly restructure the bootstrap function to use the LibMainWorkerFactory instead of the previous MainWorker::bootstrap_from_options approach.
- Implements a custom module loader factory (
UtooModuleLoaderFactory) with file system-based module loading - Updates dependency versions across the board, particularly upgrading
deno_runtimefrom 0.207.0 to 0.212.0 - Refactors the bootstrap function to use
deno_libcomponents andLibMainWorkerFactory
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/runtime/src/module_loader.rs | New module implementing custom module loader with file system support and Node.js compatibility |
| crates/runtime/src/lib.rs | Major refactoring to use deno_lib components and new worker factory pattern |
| crates/runtime/fixtures/index.js | Test fixture for ES module imports with Node.js module compatibility |
| crates/runtime/fixtures/example.js | Simple Node.js example using file system operations |
| crates/runtime/Cargo.toml | Dependency version updates and addition of new required crates |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| npm_registry_permission_checker: Arc<NpmRegistryReadPermissionChecker<RealSys>>, | ||
| sys: RealSys, | ||
| in_npm_pkg_checker: DenoInNpmPackageChecker, | ||
| cjs_tracker: Arc<CjsTracker<DenoInNpmPackageChecker, RealSys>> |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing trailing comma in function parameter list. For consistency with Rust formatting conventions, add a trailing comma after the last parameter.
| cjs_tracker: Arc<CjsTracker<DenoInNpmPackageChecker, RealSys>> | |
| cjs_tracker: Arc<CjsTracker<DenoInNpmPackageChecker, RealSys>>, |
|
|
||
| pub fn create_result(&self) -> CreateModuleLoaderResult { | ||
| let loader = Rc::new(FsModuleLoader { | ||
| shared: self.shared.clone() |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing trailing comma in struct initialization. For consistency with Rust formatting conventions, add a trailing comma after the last field.
| shared: self.shared.clone() | |
| shared: self.shared.clone(), |
|
|
||
| pub async fn bootstrap(main_js_path: &str) -> Result<(), AnyError> { | ||
| let js_path = Path::new(main_js_path); | ||
| println!("js_path: {:?}", js_path); |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statement should be removed or replaced with proper logging using the log crate that's already imported.
| println!("js_path: {:?}", js_path); | |
| info!("js_path: {:?}", js_path); |
| .create_main_worker(WorkerExecutionMode::Run, permissions, main_module.clone())?; | ||
|
|
||
| let exit_code = worker.run().await?; | ||
| println!("exit code: {:?}", exit_code); |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statement should be removed or replaced with proper logging using the log crate that's already imported.
| println!("exit code: {:?}", exit_code); | |
| info!("exit code: {:?}", exit_code); |
| } | ||
| export default mod; | ||
| const __deno_export_1__ = mod; | ||
| export { __deno_export_1__ as 'module.exports' }; No newline at end of file |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The export alias uses single quotes around 'module.exports' which is unconventional. Consider using double quotes or removing quotes entirely if the syntax allows it.
2ab3074 to
3345bb8
Compare
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
just readyEdits