1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-12 02:27:46 -05:00
denoland-deno/ext/node/polyfills/_fs
Bartek Iwańczuk ce75e31625 refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019)
This commit changes "include_js_files!" macro from "deno_core"
in a way that "dir" option doesn't cause specifiers to be rewritten 
to include it.

Example:
```
include_js_files! {
  dir "js",
  "hello.js",
}
```

The above definition required embedders to use:
`import ... from "internal:<ext_name>/js/hello.js"`. 
But with this change, the "js" directory in which the files are stored
is an implementation detail, which for embedders results in: 
`import ... from "internal:<ext_name>/hello.js"`.

The directory the files are stored in, is an implementation detail and 
in some cases might result in a significant size difference for the 
snapshot. As an example, in "deno_node" extension, we store the 
source code in "polyfills" directory; which resulted in each specifier 
to look like "internal:deno_node/polyfills/<module_name>", but with 
this change it's "internal:deno_node/<module_name>". 

Given that "deno_node" has over 100 files, many of them having 
several import specifiers to the same extension, this change removes
10 characters from each import specifier.
2023-03-10 12:47:26 +09:00
..
_fs_access.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_appendFile.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_chmod.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_chown.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_close.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_common.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_constants.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_copy.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_dir.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_dirent.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_exists.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_fdatasync.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_fstat.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_fsync.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_ftruncate.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_futimes.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_link.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_lstat.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_mkdir.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_mkdtemp.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_open.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_opendir.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_read.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_readdir.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_readFile.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_readlink.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_realpath.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_rename.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_rm.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_rmdir.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_stat.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_symlink.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_truncate.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_unlink.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_utimes.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_watch.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_write.d.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_write.mjs refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_writeFile.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_writev.d.ts refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00
_fs_writev.mjs refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019) 2023-03-10 12:47:26 +09:00