SlideShare uma empresa Scribd logo
1 de 10
Baixar para ler offline
gwt-pushstate
A library providing HTML5 History API
     support for GWT applications
Johannes Barop
●   Mail: jb@barop.de
●   Google+: http://bit.ly/jbarop
●   Github: https://github.com/jbarop
●   LinkedIn: https://www.linkedin.com/in/jbarop

●   Freelancer
●   Focus on Java and GWT
●   GWT experience since 2008
●   Hacking at GWT internals since end of last
    year
Browser history
● GWT applications usually consist only of a
  single page

● Applications should meet the user's
  expectations compared to traditional web
  pages

● URLs...
  ○ Identify a unique resource
  ○ can be linked, bookmarked and shared
GWT Standard History Mechanism
● GWT uses the fragment identifier (#) to
  provide a history state

● Chosen because updating the fragment
  doesn't causes reload

● This is a hack
GWT Standard History Mechanism
● Fragment identifier is optional and isn't a part
  of the URI itself

● "http://example.com/app.html#page_1"
  and
  "http://example.com/app.html#page_2"
  reference the same resource "app.html"
GWT Standard History Mechanism
● Many user agents do not send the fragment
  to the server
● No simple server redirect possible
● Supporting crawlers not straightforward

https://groups.google.com/forum/?fromgroups#!
topic/google-web-toolkit/w2h-b8OSm2s

https://groups.google.com/forum/google-web-
toolkit/w2h-b8OSm2s?fromgroups
HTML5 History API
● Function: window.history.pushState
● Event: onpopstate
● Browser Support:
  ○ Chrome: 5
  ○ Firefox: 4
  ○ Internet Explorer: 10
  ○ Safari: 5.0
  ○ Opera: 11.50
  ○ Mobile: It's tricky
● Support for non-pushstate browser needed
gwt-pushstate - Features
https://github.com/jbarop/gwt-pushstate

● Integrates well with GWT

● Development mode supported

● Hyperlinks with nice URLs

● Oldskool Browser support
gwt-pushstate - Caveats
● Complete path treated as history token

● Path depended stuff might break
  ○ GWT.getHostPageBaseURL()
  ○ GWTP-dispatch's auto discovery of service URLs

● Deeplinking needs server configuration
  ○ URL rewriting
Demo & Feedback
● http://gwt-pushstate-examples.appspot.com




Feedback & improvements heavily appreciated

Mais conteúdo relacionado

Mais procurados

Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Services
hannonhill
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 
C. Concept Mapping (Week # 3 - 7)
C. Concept Mapping (Week # 3 - 7) C. Concept Mapping (Week # 3 - 7)
C. Concept Mapping (Week # 3 - 7)
s1160202
 

Mais procurados (20)

Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper dive
 
Implementing Accessibility for the Web Platform (Web Engines Hackfest 2019)
Implementing Accessibility for the Web Platform (Web Engines Hackfest 2019)Implementing Accessibility for the Web Platform (Web Engines Hackfest 2019)
Implementing Accessibility for the Web Platform (Web Engines Hackfest 2019)
 
Going Back to Static HTML Sites - SEMPRO 2017
Going Back to Static HTML Sites - SEMPRO 2017Going Back to Static HTML Sites - SEMPRO 2017
Going Back to Static HTML Sites - SEMPRO 2017
 
How To Write Dynamic Migrations - Mohit Aghera
How To Write Dynamic Migrations - Mohit AgheraHow To Write Dynamic Migrations - Mohit Aghera
How To Write Dynamic Migrations - Mohit Aghera
 
Optimize All the Things WCOC 2019
Optimize All the Things WCOC 2019Optimize All the Things WCOC 2019
Optimize All the Things WCOC 2019
 
Introduction to Webcomponents
Introduction to WebcomponentsIntroduction to Webcomponents
Introduction to Webcomponents
 
East bay full stack developers meetup August 2019
East bay full stack developers meetup August 2019East bay full stack developers meetup August 2019
East bay full stack developers meetup August 2019
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
 
What's new in Silverstripe 4? (StripeCon APAC 2016)
What's new in Silverstripe 4? (StripeCon APAC 2016)What's new in Silverstripe 4? (StripeCon APAC 2016)
What's new in Silverstripe 4? (StripeCon APAC 2016)
 
Going back to static html sites / Artem Daniliants / LumoSpark
Going back to static html sites / Artem Daniliants / LumoSparkGoing back to static html sites / Artem Daniliants / LumoSpark
Going back to static html sites / Artem Daniliants / LumoSpark
 
Into the nooks and crannies of Boden’s digital transformation
Into the nooks and crannies of Boden’s digital transformationInto the nooks and crannies of Boden’s digital transformation
Into the nooks and crannies of Boden’s digital transformation
 
iPhone Web Development and Ruby On Rails
iPhone Web Development and Ruby On RailsiPhone Web Development and Ruby On Rails
iPhone Web Development and Ruby On Rails
 
Decoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCRDecoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCR
 
Lessons Learned from Building a REST API on Google App Engine
Lessons Learned from Building a REST API on Google App EngineLessons Learned from Building a REST API on Google App Engine
Lessons Learned from Building a REST API on Google App Engine
 
sponge-tech
sponge-techsponge-tech
sponge-tech
 
Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Services
 
Using Jython To Prototype Mahout Code
Using Jython To Prototype Mahout CodeUsing Jython To Prototype Mahout Code
Using Jython To Prototype Mahout Code
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Blazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksBlazor certification training - Dot Net Tricks
Blazor certification training - Dot Net Tricks
 
C. Concept Mapping (Week # 3 - 7)
C. Concept Mapping (Week # 3 - 7) C. Concept Mapping (Week # 3 - 7)
C. Concept Mapping (Week # 3 - 7)
 

Semelhante a gwt-pushstate

Introduction to Google Web Toolkit
Introduction to Google Web ToolkitIntroduction to Google Web Toolkit
Introduction to Google Web Toolkit
Didier Girard
 
Continuous integration with docker, buildbot and git
Continuous integration with docker, buildbot and gitContinuous integration with docker, buildbot and git
Continuous integration with docker, buildbot and git
Adieu
 

Semelhante a gwt-pushstate (20)

Introduction to Google Web Toolkit - part 1
Introduction to Google Web Toolkit - part 1Introduction to Google Web Toolkit - part 1
Introduction to Google Web Toolkit - part 1
 
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Tools
 
First steps with GWT @ Google IO Extended - Pordenone
First steps with GWT @ Google IO Extended - PordenoneFirst steps with GWT @ Google IO Extended - Pordenone
First steps with GWT @ Google IO Extended - Pordenone
 
GWT + Gears : The browser is the platform
GWT + Gears : The browser is the platformGWT + Gears : The browser is the platform
GWT + Gears : The browser is the platform
 
Shining a light on performance (js meetup)
Shining a light on performance (js meetup)Shining a light on performance (js meetup)
Shining a light on performance (js meetup)
 
Javascript as a target language - GWT kickoff - part1/2
Javascript as a target language - GWT kickoff - part1/2Javascript as a target language - GWT kickoff - part1/2
Javascript as a target language - GWT kickoff - part1/2
 
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
GWT HJUG Presentation
GWT HJUG PresentationGWT HJUG Presentation
GWT HJUG Presentation
 
Introduction to Google Web Toolkit
Introduction to Google Web ToolkitIntroduction to Google Web Toolkit
Introduction to Google Web Toolkit
 
Google web toolkit ( Gwt )
 Google web toolkit ( Gwt ) Google web toolkit ( Gwt )
Google web toolkit ( Gwt )
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPress
 
Making sense of the front-end, for PHP developers
Making sense of the front-end, for PHP developersMaking sense of the front-end, for PHP developers
Making sense of the front-end, for PHP developers
 
Continuous integration with docker, buildbot and git
Continuous integration with docker, buildbot and gitContinuous integration with docker, buildbot and git
Continuous integration with docker, buildbot and git
 
Gerrit JavaScript Plugins
Gerrit JavaScript PluginsGerrit JavaScript Plugins
Gerrit JavaScript Plugins
 
Hybrid mobile apps
Hybrid mobile appsHybrid mobile apps
Hybrid mobile apps
 
Gwt training presentation
Gwt training presentationGwt training presentation
Gwt training presentation
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 

gwt-pushstate

  • 1. gwt-pushstate A library providing HTML5 History API support for GWT applications
  • 2. Johannes Barop ● Mail: jb@barop.de ● Google+: http://bit.ly/jbarop ● Github: https://github.com/jbarop ● LinkedIn: https://www.linkedin.com/in/jbarop ● Freelancer ● Focus on Java and GWT ● GWT experience since 2008 ● Hacking at GWT internals since end of last year
  • 3. Browser history ● GWT applications usually consist only of a single page ● Applications should meet the user's expectations compared to traditional web pages ● URLs... ○ Identify a unique resource ○ can be linked, bookmarked and shared
  • 4. GWT Standard History Mechanism ● GWT uses the fragment identifier (#) to provide a history state ● Chosen because updating the fragment doesn't causes reload ● This is a hack
  • 5. GWT Standard History Mechanism ● Fragment identifier is optional and isn't a part of the URI itself ● "http://example.com/app.html#page_1" and "http://example.com/app.html#page_2" reference the same resource "app.html"
  • 6. GWT Standard History Mechanism ● Many user agents do not send the fragment to the server ● No simple server redirect possible ● Supporting crawlers not straightforward https://groups.google.com/forum/?fromgroups#! topic/google-web-toolkit/w2h-b8OSm2s https://groups.google.com/forum/google-web- toolkit/w2h-b8OSm2s?fromgroups
  • 7. HTML5 History API ● Function: window.history.pushState ● Event: onpopstate ● Browser Support: ○ Chrome: 5 ○ Firefox: 4 ○ Internet Explorer: 10 ○ Safari: 5.0 ○ Opera: 11.50 ○ Mobile: It's tricky ● Support for non-pushstate browser needed
  • 8. gwt-pushstate - Features https://github.com/jbarop/gwt-pushstate ● Integrates well with GWT ● Development mode supported ● Hyperlinks with nice URLs ● Oldskool Browser support
  • 9. gwt-pushstate - Caveats ● Complete path treated as history token ● Path depended stuff might break ○ GWT.getHostPageBaseURL() ○ GWTP-dispatch's auto discovery of service URLs ● Deeplinking needs server configuration ○ URL rewriting
  • 10. Demo & Feedback ● http://gwt-pushstate-examples.appspot.com Feedback & improvements heavily appreciated