Olzhas Suleimen
Olzhas Suleimen
@Levi-Lesches dart has `external` keyword for internal implementation: ```dart @b('HTTP') external List get HTTP; // generates: const List HTTP = [72, 84, 84, 80]; ```
Another way is to write and use annotations and analyzer plugin: ```dart @Throws() @Throws() void canThrowExcpetionsAndObjects() { // pass } ```
In JS, the base part of the HTTP server is implemented in native code, it's just Zig, Rust, C++ with JS bindings. In Dart case, it's all written in Dart...
Dart is used as a backend. A 2ms vs 5ms diff is not that much. If you want to improve the standard `HttpServer`, take a look at [http_io](https://github.com/ykmnkmi/http_io.dart) to experiment.
I think the timeout should be the second argument, and the rest should be the other arguments. ```dart import 'dart:js_interop'; import 'package:web/web.dart'; void main() { JSExportedDartFunction jsHandler = onEvent.toJS; window.setInterval(jsHandler,...
Use this (remove `args` if you don't need them) ```dart extension on Window { @JS('setInterval') external int setInterval$( TimerHandler handler, int timeout, [ JSAny? args, ]); } ```
Is there a way to override `dart:*` package paths? Similar to passing a path to an overridden `package_config.json`.
@kevmoo I mean that we could use it to provide paths to the patched `web` and `js_interop` packages, if that’s possible.
it's executed in _compile time_? can it be const? ```dart const List http = ascii'HTTP'; // while (stringScanner.readChar() != c'\n') {} ```
`ref`, similar to vala.