How does deno handles the modules (resolved by import
and require
keywords) ?
#215
Closed
linrongbin16
started this conversation in
General
Replies: 1 comment
-
Oh, after done read chapter 5.15, it seems my understanding's direction is correct. Maybe the description and details need to be fixed though. Close |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi, this question can be related to this project, or not. But I still want to ask here:
I'm always wondering how does the V8 engine or
deno_core
handle the js modules.At first, I'm thinking that V8 engine probably requires the runtime (i.e.
deno
,deno_core
) to implement theimport
andrequire
keywords. So when V8 is executing the js code, it can invoke these registered methods to resolve the modules.But after I read the Internals of Deno book, especially these two chapters:
In my understanding, it seems that in 5.12,
deno
simply handles all the dependencies specified in thedeno.json
orpackage.json
, download them and generated local cache (that can be directly executed by V8 engine). Then in the 5.15,deno
finally loads all the cache and compile these js codes into V8 engine, and run them.I'm not sure if my understanding is correct?
Beta Was this translation helpful? Give feedback.
All reactions