Commit 4645958
authored
fix(build): keep web apps on path routing through boot (no /#/, deep links survive) (#6639)
* fix(build): select web URL strategy before boot, not in prepareApp()
The build template called usePathUrlStrategy() from prepareApp(), which runs
after the boot UI mounts. By then Flutter's web routing had already initialized
under the default hash strategy, so path-routed web apps got /#/... URLs. Move
the strategy selection to the first statement in main(), before
FletDeepLinkingBootstrap.install() (which calls ensureInitialized) and any
runApp() — matching the before-boot ordering already used in client/lib/main.dart.
Necessary for path routing but not sufficient for cold-start deep links; see the
follow-up boot-overlay fix.
* fix(build): don't let the boot-screen MaterialApp report route '/' to the browser
The boot overlay wrapped the boot screen in MaterialApp(home: ...). A MaterialApp
with `home` builds its Navigator with reportsRouteUpdateToEngine: true, so on web
it pushes the home route '/' to the browser URL the moment it mounts — during
boot, before FletApp's real router reads the location. A cold-start deep link
like /gallery or /apps/<id> was therefore overwritten to '/'.
Verified with a headless-Chromium probe: pre-fix the URL reset /gallery -> /
~1.7s after 'Flutter app loaded' (before the Python worker even ran); post-fix
/gallery holds.
Render the boot screen via `builder:` instead of `home:`. With no
home/routes/onGenerateRoute, WidgetsApp creates no Navigator (per its own docs)
and reports nothing to the engine, so the deep link survives until the app's
router takes over. The overlay never navigates, so it needs no Navigator.
Regression from the 0.86 boot-screen rework (#6616); 0.85.3 rendered a bare
SizedBox during boot, which reported nothing.1 parent cb3ad8a commit 4645958
1 file changed
Lines changed: 24 additions & 6 deletions
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
| |||
268 | 282 | | |
269 | 283 | | |
270 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
271 | 292 | | |
272 | 293 | | |
273 | | - | |
| 294 | + | |
274 | 295 | | |
275 | 296 | | |
276 | 297 | | |
| |||
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
304 | | - | |
| 325 | + | |
| 326 | + | |
305 | 327 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | 328 | | |
311 | 329 | | |
312 | 330 | | |
| |||
0 commit comments