Skip to content

Commit 8a8eaf1

Browse files
authored
Add hotReloadSourcesUri parameter to FrontendServerDdcLibraryBundleProvider and publish DWDS 24.3.6 (#2594)
#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 f485686 commit 8a8eaf1

14 files changed

+520
-936
lines changed

Diff for: dwds/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
## 24.3.6-dev
1+
## 24.3.6
22

33
- Bump minimum sdk version to 3.7.0
44
- use 'compile js-dev' instead of directly invoking the ddc snapshot.
5+
- `FrontendServerDdcLibraryBundleStrategy` now takes a `hotReloadSourcesUri`
6+
parameter in order to fetch the file that contains the changed sources and
7+
libraries instead of assuming it exists in the global `window`.
58

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

Diff for: dwds/lib/src/handlers/injector.dart

+2
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)