From be2e0efa3987b4775837fc294eab0234a004f778 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 19 Sep 2024 10:39:44 +0100 Subject: [PATCH 1/3] Make it clear that relative base hrefs are supported for the client/runtime if appropriately formed There are some places where a relative `base href` is not supported (and these are documented/validated), but there is nothing explicitly calling out that they are supported in the client app. This adds a note to solidify this so they can be used (for example in the DevTools server) without the worry of them being undocumented. Fixes https://github.com/flutter/flutter/issues/154620 --- src/content/ui/navigation/url-strategies.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/content/ui/navigation/url-strategies.md b/src/content/ui/navigation/url-strategies.md index 0e9a15636d..4956d50c44 100644 --- a/src/content/ui/navigation/url-strategies.md +++ b/src/content/ui/navigation/url-strategies.md @@ -35,7 +35,7 @@ PathUrlStrategy uses the [History API][], which requires additional configuration for web servers. To configure your web server to support PathUrlStrategy, check your web server's -documentation to rewrite requests to `index.html`.Check your web server's +documentation to rewrite requests to `index.html`. Check your web server's documentation for details on how to configure single-page apps. If you are using Firebase Hosting, choose the "Configure as a single-page app" @@ -53,6 +53,11 @@ For example, to host your Flutter app at `my_app.dev/flutter_app`, change this tag to ``. +Relative `base href` tags are supported for release builds but they must take +into account the full URL where the page was served from. This means a relative +`base href` for a request to `/flutter_app/`, `/flutter_app/nested/route`, and +`/flutter_app/nested/route/` will be different (for example `"."`, `".."`, and +`"../.."` accordingly). [hash fragment]: https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax [`HashUrlStrategy`]: {{site.api}}/flutter/flutter_web_plugins/HashUrlStrategy-class.html From 748bfdbb5dc9bc577813486cdb500301976ae2cc Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 19 Sep 2024 10:41:31 +0100 Subject: [PATCH 2/3] Tweak linebreaks --- src/content/ui/navigation/url-strategies.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/ui/navigation/url-strategies.md b/src/content/ui/navigation/url-strategies.md index 4956d50c44..9b322e1436 100644 --- a/src/content/ui/navigation/url-strategies.md +++ b/src/content/ui/navigation/url-strategies.md @@ -54,10 +54,10 @@ For example, to host your Flutter app at this tag to ``. Relative `base href` tags are supported for release builds but they must take -into account the full URL where the page was served from. This means a relative -`base href` for a request to `/flutter_app/`, `/flutter_app/nested/route`, and -`/flutter_app/nested/route/` will be different (for example `"."`, `".."`, and -`"../.."` accordingly). +into account the full URL where the page was served from. +This means a relative `base href` for a request to `/flutter_app/`, +`/flutter_app/nested/route`, and `/flutter_app/nested/route/` will be different +(for example `"."`, `".."`, and `"../.."` accordingly). [hash fragment]: https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax [`HashUrlStrategy`]: {{site.api}}/flutter/flutter_web_plugins/HashUrlStrategy-class.html From 5578f03e7821a7beb811355bd1eb763df85c8b44 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 19 Sep 2024 15:31:01 +0100 Subject: [PATCH 3/3] Update src/content/ui/navigation/url-strategies.md Co-authored-by: Mouad Debbar --- src/content/ui/navigation/url-strategies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/ui/navigation/url-strategies.md b/src/content/ui/navigation/url-strategies.md index 9b322e1436..e3b92806ff 100644 --- a/src/content/ui/navigation/url-strategies.md +++ b/src/content/ui/navigation/url-strategies.md @@ -57,7 +57,7 @@ Relative `base href` tags are supported for release builds but they must take into account the full URL where the page was served from. This means a relative `base href` for a request to `/flutter_app/`, `/flutter_app/nested/route`, and `/flutter_app/nested/route/` will be different -(for example `"."`, `".."`, and `"../.."` accordingly). +(for example `"."`, `".."`, and `"../.."` respectively). [hash fragment]: https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax [`HashUrlStrategy`]: {{site.api}}/flutter/flutter_web_plugins/HashUrlStrategy-class.html