Goal: Get basic worker creation working with new Deno APIs
Files to modify:
crates/js/src/javascript.rs(main implementation file)
Specific changes:
-
Remove
program_state: Option<Arc<deno::program_state::ProgramState>>field (line 103) -
Remove
set_program_state()andget_program_state()methods (lines 219-225) -
Update worker initialization in
js_initialize()function (around line 1740-1753):- Remove:
let program_fut = futures::executor::block_on(deno::program_state::ProgramState::build(flags)); - Remove:
let mut worker = deno::create_main_worker(&program, main_module.clone(), permissions); - Add: Direct
MainWorker::bootstrap_from_options()call withWorkerOptions
- Remove:
-
Update imports at top of file:
- Remove any
use deno::*imports (none currently - good!) - Already have
deno_runtime::worker::MainWorkerimported ✓ - Add:
use deno_runtime::permissions::PermissionsContainer; - Add:
use deno_core::ModuleSpecifier; - Add:
use std::rc::Rc;
- Remove any
Goal: Update all subcommand implementations
Comment out for now, implement later:
get_subcommand()function (line 1965+)- All subcommand handling in
js_cli()function
Goal: Implement custom ModuleLoader for file caching
- Create custom
EmacsModuleLoaderstruct implementingdeno_core::ModuleLoadertrait - Replace old
file_fetcherpattern (lines 1781-1787)
- Test
eval-jswith simple JavaScript - Test
eval-tswith TypeScript smoke test - Verify object passing through FFI
- Analysis complete
- Build system resolved (globals.h generated)
- Phase 1: Worker initialization (IN PROGRESS)
- Phase 2: Subcommands (deferred)
- Phase 3: Module loading (deferred)
- Phase 4: Testing
- Comment out subcommand code to reduce compile errors
- Update worker initialization to use new API
- Test basic eval-js functionality
- Incrementally add features back