Skip to content

Commit

Permalink
Add hotReloadSourcesUri parameter to FrontendServerDdcLibraryBundlePr…
Browse files Browse the repository at this point in the history
…ovider and publish DWDS 24.3.6

dart-lang#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.
  • Loading branch information
srujzs committed Mar 3, 2025
1 parent ee65f5c commit 13310e8
Show file tree
Hide file tree
Showing 14 changed files with 521 additions and 936 deletions.
5 changes: 4 additions & 1 deletion dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 24.3.6-dev
## 24.3.6

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

## 24.3.5
- Allow clients to specify the `packageConfigPath` in `LoadStrategy` class and associated providers.
Expand Down
2 changes: 2 additions & 0 deletions dwds/lib/src/handlers/injector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'dart:isolate';

import 'package:crypto/crypto.dart';
import 'package:dwds/src/config/tool_configuration.dart';
import 'package:dwds/src/loaders/ddc_library_bundle.dart';
import 'package:dwds/src/version.dart';
import 'package:logging/logging.dart';
import 'package:shelf/shelf.dart';
Expand Down Expand Up @@ -203,6 +204,7 @@ Future<String> _injectedClientSnippet(
'window.\$dartEmitDebugEvents = ${debugSettings.emitDebugEvents};\n'
'window.\$isInternalBuild = ${appMetadata.isInternalBuild};\n'
'window.\$isFlutterApp = ${buildSettings.isFlutterApp};\n'
'${loadStrategy is DdcLibraryBundleStrategy ? 'window.\$hotReloadSourcesPath = "${loadStrategy.hotReloadSourcesUri.toString()}";\n' : ''}'
'${loadStrategy.loadClientSnippet(_clientScript)}';

if (extensionUri != null) {
Expand Down
Loading

0 comments on commit 13310e8

Please sign in to comment.