gwt-pushstate: Easy to use HTML5 pushState support for GWT

504 views
Skip to first unread message

Johannes Barop

unread,
Nov 21, 2012, 12:16:50 PM11/21/12
to google-we...@googlegroups.com
Hello GWT community,

I've just released gwt-pushstate. It implements HTML5 pushState with GWTs standard History API and should work with existing applications fairly well. It also makes sure that the development mode doesn't break and provides a transparent fallback for non-pushState browsers. It's open source (Apache2) and uploaded to the Maven central repository. You can find the source here: https://github.com/jbarop/gwt-pushstate

A running sample application is uploaded here: http://gwt-pushstate-examples.appspot.com
The sample is basicly GWTP-0.7's gwtp-sample-hplace with little modifications to add the pushState support: https://github.com/jbarop/gwt-pushstate/commit/a3d278b2fae71adc4ea7fb22c5eb121ada36b644


Any feedback heavily appreciated.
Johannes

Thomas Broyer

unread,
Nov 21, 2012, 12:38:19 PM11/21/12
to google-we...@googlegroups.com
Just a small note: why are you inheriting c.g.g.logging.Logging? You don't need to inherit anything if you just use java.util.logging, and if you need to use classes from c.g.g.logging.client then you should rather inherit LoggingDisabled.
Message has been deleted

Johannes Barop

unread,
Nov 21, 2012, 1:27:09 PM11/21/12
to google-we...@googlegroups.com
Fixed it.


Note to myself. Never drink Jågermeister and push to git. :)

Am 21.11.2012 um 18:49 schrieb Johannes Barop:

Thanks for pointing that out.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/NyulPSwagEIJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Thomas Broyer

unread,
Nov 21, 2012, 2:19:25 PM11/21/12
to google-we...@googlegroups.com


On Wednesday, November 21, 2012 7:27:44 PM UTC+1, Johannes Barop wrote:

Note to myself. Never drink Jågermeister and push to git. :)

Indeed! ;-)

ChrisK

unread,
Dec 12, 2012, 7:07:48 AM12/12/12
to google-we...@googlegroups.com
Great work! 

As far as I can see it will remove query parameters when using pushState? I may extend it to support passing through all query parameters rather than just "gwt.codesvr".

Johannes Barop

unread,
Dec 12, 2012, 8:39:47 AM12/12/12
to google-we...@googlegroups.com
Hey,

thanks for your feedback!

'gwt.codesvr' is only filtered. Other query-string parameters should not be altered. However I've decided to add the query-string to the historyToken. It turned out that this is a bad idea because then "place" is not the same place as "place?some=foo". This may cause the effect of removing the complete query string.
The place "!homePage?foo=bar" is not found and the user get's redirected to "http://gwt-pushstate-examples.appspot.com/!homePage"

I'm going to fix that soon.


BTW: If you have changes I would appreciate it if you push the changes back.


Cheers,
Johannes


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
Message has been deleted

Johannes Barop

unread,
Dec 12, 2012, 5:41:42 PM12/12/12
to google-we...@googlegroups.com
Thanks for pointing this problem out!

I digged a bit and found out that History.init() is called before the HistoryAsserter because LoggingConfiguration does use History. Now I see that having a separate EntryPoint for the History is a semi productive idea!

I'll fix this tomorrow!

Cheers,
Johannes

Am 12.12.2012 um 15:16 schrieb ChrisK <ckno...@gmail.com>:

No problem.

It seems to stem from how pushState expects the query string to also be pushed in as well I think? As long as query parameters on links are maintained I think it should be fine.

I'm having trouble getting HistoryAsserter to run before HistoryImplPushState.init() which means on pushState supported browser, any query string param apart from "'gwt.codesvr" gets removed by the first line in HistoryImplPushState.init() before the HistoryConverter has a chance to kick in. Perhaps I've missing something. It means hitting a URL like this:

Actually goes to:

i.e. it loses the initial query parameters by the time the app loads
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
Reply all
Reply to author
Forward
0 new messages