You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2026/06/22 17:51:31 UTC

(royale-asjs) branch develop updated (b77436f703 -> 9632fc190a)

This is an automated email from the ASF dual-hosted git repository.

greg-dove pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


    from b77436f703 Routing supports replaceState
     new 74f65ce568 The routers write history entries via history.pushState() / replaceState(). But back/forward by user over those entries is signaled by "popstate" (hashChange only is not reliable for HashRouter, and this extra popstate response is needed also for BrowserRouter)
     new 9632fc190a Fix router parameter parsing to clear stale params on URLs without queries

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../Basic/src/main/royale/org/apache/royale/routing/BrowserRouter.as  | 4 ++++
 .../Basic/src/main/royale/org/apache/royale/routing/HashRouter.as     | 1 +
 .../src/main/royale/org/apache/royale/routing/RouteToParameters.as    | 3 +++
 3 files changed, 8 insertions(+)


(royale-asjs) 02/02: Fix router parameter parsing to clear stale params on URLs without queries

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

greg-dove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9632fc190a818ff7dae7f72fcadd75b1b99f5a2a
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Jun 22 19:22:32 2026 +0200

    Fix router parameter parsing to clear stale params on URLs without queries
---
 .../src/main/royale/org/apache/royale/routing/RouteToParameters.as     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/RouteToParameters.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/RouteToParameters.as
index e5703f3842..b6fd57925c 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/RouteToParameters.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/RouteToParameters.as
@@ -64,7 +64,10 @@ package org.apache.royale.routing
       var hash:String = event.value;
       var index:int = hash.indexOf("?");
       if(index == -1)//no params
+      {
+        host.routeState.parameters = {};
         return;
+      }
       hash = hash.slice(index + 1);
       index = hash.indexOf("#");
       if(index != -1)


(royale-asjs) 01/02: The routers write history entries via history.pushState() / replaceState(). But back/forward by user over those entries is signaled by "popstate" (hashChange only is not reliable for HashRouter, and this extra popstate response is needed also for BrowserRouter)

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

greg-dove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 74f65ce568d49517e7b45eaecb0885d385131b36
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Jun 22 17:29:54 2026 +0200

    The routers write history entries via history.pushState() / replaceState().
    But back/forward by user over those entries is signaled by "popstate" (hashChange only is not reliable for HashRouter, and this extra popstate response is needed also for BrowserRouter)
---
 .../Basic/src/main/royale/org/apache/royale/routing/BrowserRouter.as  | 4 ++++
 .../Basic/src/main/royale/org/apache/royale/routing/HashRouter.as     | 1 +
 2 files changed, 5 insertions(+)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/BrowserRouter.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/BrowserRouter.as
index 91d5327801..b65b127a78 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/BrowserRouter.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/BrowserRouter.as
@@ -117,6 +117,10 @@ package org.apache.royale.routing
 		public function set strand(value:IStrand):void
 		{	
 			_strand = value;
+			COMPILE::JS
+			{
+				window.addEventListener("popstate", locationChangeHandler);
+			}
 			// wait until the app is initialized. Calling onInit async solves this problem
 			callLater(onInit);
 		}
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/HashRouter.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/HashRouter.as
index 188e5918dd..c443e69371 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/HashRouter.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/routing/HashRouter.as
@@ -113,6 +113,7 @@ package org.apache.royale.routing
 			COMPILE::JS
 			{
 				window.addEventListener("hashchange", hashChangeHandler);
+				window.addEventListener("popstate", hashChangeHandler);
 			}
 			// wait until the app is initialized. Calling onInit async solves this problem
 			callLater(onInit);