Tags: dart-lang/webdev
Tags
[ DWDS ] Disconnect non-DDS clients when DDS connects (#2671) The native VM service disconnects all non-DDS clients when DDS connects in order to keep state consistent. DWDS was never configured to work this way and, instead, would not let DDS connect if there were already existing clients. This is fine most of the time, as DDS is typically the first client, but in cases where multiple DDS instances attempt to start at once (e.g., a simultaneous `flutter run` and `flutter attach`), this inconsistency prevents tools from falling back to using an already connected DDS instance, as seen in flutter/flutter#171758. Fixes #2399
- Fix issue where DDS would fail to initialize if DWDS already had ex… …isting clients.
[dwds] Fix bug where no-op hot restart doesn't cancel a subscription … …and publish 25.0.1 (#2668) In hot restart, we wait for all sources to be parsed before continuing to create the isolate. In order to do so, we listen on parsed sources by registering a subscription. In the case where we have no sources to restart, we don't cancel the subscription. This results in an issue where on the next hot restart that contains changes, the old subscription is triggered, potentially completing an already completed completer. Instead, we should always cancel the subscription. Hot reload code is changed as well to do the same. Additional checks are added to check if the completer is completed before we complete again. While this is not needed for this issue, it is possible other sources can be downloaded by the app, which may trigger the function in the listener, which could potentially try and complete the completed completer. Tests are added for both hot restart and hot reload to check that alternating empty hot restarts and non-empty hot restarts work.
[dwds] Wait for scripts to be parsed on a hot restart and publish DWD… …S 25.0.0 (#2667) Like #2640, we should wait until scripts are parsed before continuing a hot restart. Otherwise, metadata can be stale and breakpoints may be placed in the wrong files. For now, we only do this in the DDC library bundle format as we don't have a way to fetch the changed libraries in the AMD format. - hotReloadSourcesUri is repurposed to be reloadedSourcesUri, which is a breaking change. This file is now used for both hot restart and hot reload to detail the changed files across either. - Injected client is changed to return the mapping within this uri when a hot reload is executed. - Completer is added to ChromeProxyService to wait until all scripts are parsed before recreating the isolate, which will reinitialize all metadata. - Fix a preexisting race condition where we don't listen for a kIsolateStart event early enough. This should help fix the Windows flakes for hot_restart_breakpoints_test.dart.
Support running DWDS without a Chrome Debug Port (web-socket-based) (#… …2639) * implemented socket-based dwds * fix issue with run main at start * updated changelog * simulate debugExtension in websocket-based execution flow * added multiwindow support * refactoring and removing unused method * support page refresh from vsCode * refactor createisolate and resume method * implemented pause/resume logic * improve canReuseConnection logic * comments cleanup * fixed canReuseConnection logic * implemented _handleConnectionClosed and fix issue with getVM * fix issue with handling isolate cleanup * addressed comments regarding closing remoteDebugger * code cleanup * created common interface for debugService and webSocketDebugService * remove use of _acceptNewConnections in WebSocketDebugService * created proxy_service.dart and consolidated all duplicated code * consolidate webSocketAppDebugService and AppDebugServices * consolidate dwdsVmClient and WebSocketDwdsVmClient * refactored can remove duplicate methods * remove use of dynamic * fix dev_handler error * consolidate handleChromeMessages and handleWebSocketMessages created default createIsolate and destroyIsolate in ProxyService * updated logg message in _sendRequestToClients * updated dev_handler to throw error if proxy_service is not the right type * addressing analyzer issues * removed unused variable * updated port to 44456 * refactored classes to and interface names to be more clear * fix variable name error * updated variable to be type * prepare version 24.4.1 for release
Invalidate caches after a hot reload (#2641) Many of the caches we computed on the original load need to be invalidated. Previously, we pessimistically tore down the caches and reinitialized them. With this PR, a ModifiedModuleReport is computed that allows us to only invalidate and recompute information for modules/libraries that were either deleted or reloaded. Specifically, the caches in MetadataProvider, Modules, Locations, SkipLists, AppInspector, and LibraryHelper are now specially invalidated and recomputed. Removes an existing option to use the module URI instead of the module name in the MetadataProvider. This option is not relevant until we can unify this change across the ecosystem. Fixes #2628.
Fix duplicate connection/logs in Webdev (#2635) * bump dwds version to 24.3.9 * updated dwds constraints to 24.3.11 * fix duplicate logs * fix duplicate logs * Revert "fix duplicate logs" This reverts commit 2ccd2d9. * updated changelog * check and resuse active app state for each appId * addressed comments
modifying DWDS Injector to always inject client and introduce useDwds… …WebSocketConnection flag (#2629) * modifying injector to always inject client and introduce runMainAtStart flag * mark fields as deprecated * added method to mark application as completed to avoid calling main() twice * added a flag to determine the communication protocol; temporirily use it to trigger main * addressed comment in client.dart
[dwds] Split hot reload callback into 2, disable breakpoints in chang… …ed files, and publish 24.3.10 (#2606) dart-lang/sdk#60186 Breakpoints are currently broken when doing a hot reload when files change. They either are not re-mapped or point to the wrong location. For now, we should disable them in the changed libraries. In order to do this, we split the hot reload implementation into 2 in order to get the list of changed libraries. The call to hot reload will later use the cached list to call out to the embedder. Note that this likely won't change any behavior. New JS files already don't have breakpoints, so this PR should be mostly about cleaning up bookkeeping.
PreviousNext