dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.28k stars 1.58k forks source link

[frontend_server] Deprecate `moduleName` from compile-expression-to-js #58265

Open srujzs opened 2 days ago

srujzs commented 2 days ago

moduleName is only ever used in one place - to cache the DDC program compiler so that it can be reused for expression evaluation: https://github.com/dart-lang/sdk/blob/6dac184012f61df7481f8efc070740d01d3f6df5/pkg/frontend_server/lib/src/javascript_bundle.dart#L234 https://github.com/dart-lang/sdk/blob/6dac184012f61df7481f8efc070740d01d3f6df5/pkg/frontend_server/lib/frontend_server.dart#L1128. With the DDC library bundle format, we no longer use module names. Instead, we should cache the compiler based on the library uri. Therefore, moduleName can be deprecated from the request. Removing it would be a breaking change, however.