Closed Artyom-ARS closed 9 years ago
I agree with you that it's not clear enough. As an example I saw that developers in their application use insertRendering instead of using LoadOnDemandPanel. So it's better to use existing control than implement the same behavior using Speak core api.
Using global scope it's a separate issue. As I can see global scope (window) is littered a lot in applications. I think it's because of misstakes. But I saw somewhere guidance about it.
Oh ok. I see you mean try to use as much as possible existing components instead of trying to build your application directly using the SPEAK Core API in order to increase code re-use.
As an example:
Favor the use of an LoadOnDemandPanel instead of the InsertRendering
Is that right? And do you see other example other than the LoadOnDemandPanel?
Yes, you're right. I can't remember other examples.
OK, so I suggest that we add the following guidance to the Application Development/PageCode/JavaScript.md file:
Do you both agree? If so, I will close this pull request and make this change myself.
I agree with that.
Me too.
Done.
Hello Artem,
IMO,I think the line is not clear enough in its current state.
I am not sure what are you referring to when you speak about the Speak Core. Is it Sitecore.Speak namespace or Sitecore.Speak.app (the root application) ? What you are maybe saying is that you should avoid referencing global object through the code and use module definition (define from requireJS) ?