-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ITV-2200 Deprecate the use of *history=broadcast #527
Conversation
acarlson0000
commented
Dec 6, 2018
- Pass through currentUrlParams to Historian
- Update usages of hash fragment to utilize query param
- Pass through currentUrlParams to Historian - Update usages of hash fragment to utilize query param
*/ | ||
hasBroadcastOrigin: function hasBroadcastOrigin () { | ||
return this._historyArray.length > 0 && this._historyArray[this._historyArray.length - 1] === Historian.HISTORY_TOKEN + Historian.BROADCAST_ENTRY; | ||
return this._urlParams.length > 0 && this._urlParams[Historian.BROADCAST_ENTRY] === true; | ||
} | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to remove the BROADCAST_ENTRY and everything to do with history= if we are moving away from this as a concept.
Then update any partner specs we have which i'm sure there were a few years ago.
Need to speak with @aevans-bbc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this was re-factored to remove. I guess we'll need to put some tickets in for the updates to partner specs now?
- Incorrect usage of `this`, func not in scope
static/script/historian.js
Outdated
@@ -18,9 +18,10 @@ define( | |||
* @constructor | |||
* @ignore | |||
*/ | |||
init: function init (currentUrl) { | |||
init: function init (currentUrl, UrlAppParams) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually - if currentUrl already contains the query parameters then no need to pass in the UrlAppParams right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true - essentially this could be achieved by currentUrl.match(/broadcast=true/) but this seemed far too hacky. Took this approach rather than a) pulling lib/application into historian b) re-implementing the queryParam extraction - but I'm happy with either way really :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny bit of human linting...
init: function init (currentUrl, UrlAppParams) { | |
init: function init (currentUrl, urlAppParams) { |
static/script/historian.js
Outdated
@@ -18,9 +18,10 @@ define( | |||
* @constructor | |||
* @ignore | |||
*/ | |||
init: function init (currentUrl) { | |||
init: function init (currentUrl, UrlAppParams) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny bit of human linting...
init: function init (currentUrl, UrlAppParams) { | |
init: function init (currentUrl, urlAppParams) { |
static/script/historian.js
Outdated
var i; | ||
|
||
this._urlParams = UrlAppParams; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._urlParams = UrlAppParams; | |
this._urlParams = urlAppParams; |
Preparing to remove Historian.hasBroadcastOrigin()
Has now been replaced by application.hasBroadcastOrigin(). It is necessary to pass broadcast=true to any new URL launched via Historian.forward() if you want to propagate broadcast trust to the TAL child app.
After discussion, we decided we could remove the broadcast-history related stuff from Historian straight away. Awareness of whether the app has a 'broadcast origin' is now moved up a level, to Application. It would be good if you can take another look, @acarlson0000! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good - although i feel this will set a precedence to add other getters in the application :-P
Yep, agree this is much cleaner. LGTM |