Pancake/French Toast/Message API: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Added note on SOA)
Line 29: Line 29:


''Can somebody who worked on the session stuff in the past verify that these could satisfy the user story?'' - [[Gbrander]]
''Can somebody who worked on the session stuff in the past verify that these could satisfy the user story?'' - [[Gbrander]]
''What about the way it works today are we wanting to fix? This functionality currently resides in the misnamed/misplaced [https://github.com/mozillapancake/pancake-ft-client/blob/app-skeleton/js/lib/signin.js lib/signin]. ITSM that the modules under service/* could be FrenchToast.*. Lets talk.'' - [[Sfoster]]


==== As a front-end developer, I need access to a shared store that persists across sessions. All layers should have access to this store. ====
==== As a front-end developer, I need access to a shared store that persists across sessions. All layers should have access to this store. ====

Revision as of 13:12, 11 September 2012

User stories

As a front-end developer, I need a way to tell the native app to open a new layer containing a specific layer state.

 FrenchToast.openApplicationView(url)

As a front-end developer, I need a way to tell the native app to open a URL in the viewer.

 FrenchToast.openPublicView(url)

I don't think we need the name parameter. I don't think we want layers to be able to talk directly to each other. Instead, I believe we can stick to a service-oriented architecture based on URLs. -Gbrander

As a front-end developer, I need the app to tell me when a layer has received focus so that I can check for updates and refresh data if necessary.

What about a DOM event?

 window.addEventListener('layerFocus', fn)

As a front-end developer, I need a way to securely verify that the user is authenticated so that I do not expose confidential information.

 // find out if the current session is valid
 FrenchToast.getSession()
 
 // to start browserid
 FrenchToast.startBrowserId(callback)
 
 // to validate the browserid token
 FrenchToast.validateBrowserIdReceipt(receipt, callback)

Can somebody who worked on the session stuff in the past verify that these could satisfy the user story? - Gbrander

What about the way it works today are we wanting to fix? This functionality currently resides in the misnamed/misplaced lib/signin. ITSM that the modules under service/* could be FrenchToast.*. Lets talk. - Sfoster

As a front-end developer, I need access to a shared store that persists across sessions. All layers should have access to this store.

Use standard localStorage to serialize/deserialize persisted app data.

 window.localStorage
 JSON.stringify
 JSON.parse

Can we confirm that the same localStorage is available between UIWebViews - Gbrander

Discussion

I don't think we need a general message mechanism to talk to the app. I also don't think we need to be able to send messages to specific layers from specific layers. In general, I would like to make the coupling between layers loose, and based on requesting URLs be opened. The layer itself can decide what to do with the URL. -Gbrander