summaryrefslogtreecommitdiff
path: root/runtime/examples/extension_with_ops/main.rs
AgeCommit message (Collapse)Author
2024-03-14fix(cli): unbreak extension example and fix __runtime_js_sources (#22906)Matt Mastracci
Better example to close https://github.com/denoland/deno/issues/22600 --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-09-21refactor: rewrite some ops to op2 macro (#20603)Bartek Iwańczuk
2023-06-26Revert "Reland "refactor(core): cleanup feature flags for js source i… ↵Bartek Iwańczuk
(#19611) …nclusion" (#19519)" This reverts commit 28a4f3d0f5383695b1d49ccdc8b0f799a715b2c2. This change causes failures when used outside Deno repo: ``` ============================================================ Deno has panicked. This is a bug in Deno. Please report this at https://github.com/denoland/deno/issues/new. If you can reliably reproduce this panic, include the reproduction steps and re-run with the RUST_BACKTRACE=1 env var set and include the backtrace in your report. Platform: linux x86_64 Version: 1.34.3+b37b286 Args: ["/opt/hostedtoolcache/deno/0.0.0-b37b286f7fa68d5656f7c180f6127bdc38cf2cf5/x64/deno", "test", "--doc", "--unstable", "--allow-all", "--coverage=./cov"] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failed to read "/home/runner/work/deno/deno/core/00_primordials.js" Caused by: No such file or directory (os error 2)', core/runtime/jsruntime.rs:699:8 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
2023-06-25Reland "refactor(core): cleanup feature flags for js source inclusion" (#19519)Nayeem Rahman
Relands #19463. This time the `ExtensionFileSourceCode` enum is preserved, so this effectively just splits feature `include_js_for_snapshotting` into `exclude_js_sources` and `runtime_js_sources`, adds a `force_include_js_sources` option on `extension!()`, and unifies `ext::Init_ops_and_esm()` and `ext::init_ops()` into `ext::init()`.
2023-06-13Revert "refactor(core): cleanup feature flags for js source inclusion… ↵Bartek Iwańczuk
(#19490) … (#19463)" This reverts commit ceb03cfb037cf7024a5048b17b508ddda59cfa05. This is being reverted because it causes 3.5Mb increase in the binary size, due to runtime JS code being included in the binary, even though it's already snapshotted. CC @nayeemrmn
2023-06-13refactor(core): cleanup feature flags for js source inclusion (#19463)Nayeem Rahman
Remove `ExtensionFileSourceCode::LoadedFromFsDuringSnapshot` and feature `include_js_for_snapshotting` since they leak paths that are only applicable in this repo to embedders. Replace with feature `exclude_js_sources`. Additionally the feature `force_include_js_sources` allows negating it, if both features are set. We need both of these because features are additive and there must be a way of force including sources for snapshot creation while still having the `exclude_js_sources` feature. `force_include_js_sources` is only set for build deps, so sources are still excluded from the final binary. You can also specify `force_include_js_sources` on any extension to override the above features for that extension. Towards #19398. But there was still the snapshot-from-snapshot situation where code could be executed twice, I addressed that by making `mod_evaluate()` and scripts like `core/01_core.js` behave idempotently. This allowed unifying `ext::init_ops()` and `ext::init_ops_and_esm()` into `ext::init()`.
2023-06-03refactor(core): remove force_op_registration and cleanup ↵Nayeem Rahman
JsRuntimeForSnapshot (#19353) Addresses https://github.com/denoland/deno/pull/19308#discussion_r1212248194. Removes force_op_registration as it is no longer necessary.
2023-05-31feat(runtime): Add example for extension with ops (#19204)Exidex
Spend quite some time trying to get this working. With proper example would have been a lot faster. So this is pr with the example. I also rearranged examples a little bit to allow for addition of more examples