Skip to content

Commit 13310e8

Browse files
committed
Add hotReloadSourcesUri parameter to FrontendServerDdcLibraryBundleProvider and publish DWDS 24.3.6
#2584 During hot reload, a JSON file that contains the sources and libraries that need to be loaded and reloaded is expected. Before, Flutter tools was adding this script to the global window. It should instead be directly passed to the provider to be used later.
1 parent ee65f5c commit 13310e8

File tree

14 files changed

+521
-936
lines changed

14 files changed

+521
-936
lines changed

dwds/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
## 24.3.6-dev
1+
## 24.3.6
22

33
- Bump minimum sdk version to 3.7.0
4+
- `FrontendServerDdcLibraryBundleStrategy` now takes a `hotReloadSourcesUri`
5+
parameter in order to fetch the file that contains the changed sources and
6+
libraries instead of assuming it exists in the global `window`.
47

58
## 24.3.5
69
- Allow clients to specify the `packageConfigPath` in `LoadStrategy` class and associated providers.

dwds/lib/src/handlers/injector.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'dart:isolate';
99

1010
import 'package:crypto/crypto.dart';
1111
import 'package:dwds/src/config/tool_configuration.dart';
12+
import 'package:dwds/src/loaders/ddc_library_bundle.dart';
1213
import 'package:dwds/src/version.dart';
1314
import 'package:logging/logging.dart';
1415
import 'package:shelf/shelf.dart';
@@ -203,6 +204,7 @@ Future<String> _injectedClientSnippet(
203204
'window.\$dartEmitDebugEvents = ${debugSettings.emitDebugEvents};\n'
204205
'window.\$isInternalBuild = ${appMetadata.isInternalBuild};\n'
205206
'window.\$isFlutterApp = ${buildSettings.isFlutterApp};\n'
207+
'${loadStrategy is DdcLibraryBundleStrategy ? 'window.\$hotReloadSourcesPath = "${loadStrategy.hotReloadSourcesUri.toString()}";\n' : ''}'
206208
'${loadStrategy.loadClientSnippet(_clientScript)}';
207209

208210
if (extensionUri != null) {

0 commit comments

Comments
 (0)