Conversation
…eds for async ops
- as a result, order is not important with map/webmap mixins
9043663 to
f3cf778
Compare
d997a06 to
9300ebb
Compare
|
@tmcgee @DavidSpriggs Can this be merged? |
|
@roemhildtg As you know for our conversations, I like this. I have not yet had time to run through it locally and consider how it relates to other mixins I have created/used and am considering. There might be a tweak or 2 as an outcome but I think it is good direction and very close to done. |
|
Sounds good, I just wanted to see where we're at. I have some additional mixin ideas and would like to have this merged before I started exploring those. |
tmcgee
left a comment
There was a problem hiding this comment.
3 places where promise/all is included but not used.
1 change to the final call to createWidgets
| 'dojo/dom-geometry', | ||
| 'dojo/sniff', | ||
| 'dojo/Deferred', | ||
| 'dojo/promise/all', |
There was a problem hiding this comment.
promiseAll is not used in this Mixin
| 'dojo/dom', | ||
| 'dojo/_base/array', | ||
| 'dojo/Deferred', | ||
| 'dojo/promise/all', |
There was a problem hiding this comment.
promiseAll is not used in this Mixin
There was a problem hiding this comment.
One more then you can take that well-deserved day-off. 😉
| 'dojo/_base/declare', | ||
| 'dojo/_base/lang', | ||
| 'dojo/_base/array', | ||
| 'dojo/promise/all', |
There was a problem hiding this comment.
promiseAll is not used in this Mixin
| if (this.layoutDeferred) { | ||
| promiseAll([this.mapDeferred, this.layoutDeferred]) | ||
| .then(lang.hitch(this, | ||
| 'createWidgets', ['titlePane', 'contentPane', 'floating', 'domNode', 'invisible', 'layout'] |
There was a problem hiding this comment.
this final call to createWidgets should pass null or this.widgetTypes. This allows the dev to not have to override this entire function if they add any custom widget types.
There was a problem hiding this comment.
No. Each widget can only be loaded once based on the key in the widgets object (or the id property, if provided). The code in the createWidget method checks to see if a widget with the same key/id has already been loaded.
There was a problem hiding this comment.
Yup, I saw that after I commented. (then I deleted my comment but you were too quick 😄 )
There was a problem hiding this comment.
so now it looks like I was responding only to the voices in my head! 😮
|
After my review, I tested these changes with my WAB Widgets mixin, Calcite Maps mixin and my work-in-progress mixins for version 4.x of the Esri JavaScript API. As I expected, this required a few minor changes in the 4.x mixins. Other than that, it seemed to work well without a hitch. With this change, I think I might be able to remove some of the override functions in my mixins. nice work! |
| } | ||
| if (this.layoutDeferred) { | ||
| promiseAll([this.mapDeferred, this.layoutDeferred]) | ||
| .then(lang.hitch(this, 'createWidgets')); |
There was a problem hiding this comment.
you have to pass an argument (null or this.widgetTypes). No widgets are created when you don't.
There was a problem hiding this comment.
I thought that this.widgetTypes is used automatically here
widgetTypes = widgetTypes || this.widgetTypes;
There was a problem hiding this comment.
The link doesn't work but its line 75 of _WidgetsMixin
There was a problem hiding this comment.
it does't use this.widgetTypes when it is called this way using lang.hitch. I tried that before posting my original suggestion.
There was a problem hiding this comment.
Ahh, I see. since lang.hitch is passing the arguments from promiseAll.
| }, | ||
|
|
||
| createWidgets: function (widgetTypes) { | ||
| debugger; |
There was a problem hiding this comment.
I hate it when I leave these in code! ;)
There was a problem hiding this comment.
I swear I removed that...ahh, I must've staged it before I removed that line. Its my day off, I need a break :)
2a7f35a to
ce28af2
Compare
this.inheritedloadConfig- a method that can load and modify the config object before the app begins loadingpostConfig- a method that can initialize app variables and perform any necessary operations after the config is loaded and processed, but before startup happensstartup- a method that starts the app layout, map, widgets, etc