I haven't digged deeper into this but what right now confuses me is why I can choose between React and Knockout. What if I like to use react and knockout together or does kockout include react?
I think it might be a little bit confusing in the generator.
Can you elaborate on the case when you'd want to use two different rendering frameworks at the same time in a single component?
Many people use knockout together with React. React is better for templating while kockout is better on databinding.
Pretty common use case.
@StfBauer You can have databinding with react, in my projects i just use react. each one has your context here :smile:
If all uses cases are going to be covered then this list will be veeery long. You can always add/change framework at a later stage.
Keep it down to 2-3 options. Perhaps the wording could change, to "What framework would you like to start with"?
Thanx @wictorwilen that's what I meant. Would make it more clear that it is just the starting point and not limited to that.
It was not meant as a technical issue more a wording one.
IMO it would make more sense this way.
Currently we do not have a sample that mixes ReactJS and Knockout in one web part since both provide templating and other overlapping functionality. Most cases we have seen are either/or.
Well in this case, I think the approach is correct (keep it simple, it already have a lot of extra artifacts), I don't see a generator matching all needs. I hope MS team will publish on github the Yeoman Generator, so in that case you can use it and make one yourself in top of it with your own customizations to mix any framework you want, in the way you need.
Remember that generator is just another Yeoman generator.... even, you can make your own, and mix some others already on Yeoman Yeoman Generators
@rgarita Good point. Right now it is pretty locked down without being able to write your own generator based upon. You can't even add your additional gulp task if you like.
My big hope is that this is somehting that changes in future and it will be more open.
Right now it's just a tool set that will be deployed via yeoman generator but way beyond a normal generator.
So yes - we would like to publish the yeoman generator. As for the "picking multiple frameworks", that is completely possible. At that point it's likely that you would be wanting to have your own base classes rather than the ones that come in the yeoman generator, as they tend to include templating and data binding together. We just need to make sure that the documentation on how to include libraries is clear (or somehow have an additional step like 'what external libraries would you like to load' or something like that.
@StfBauer curious if you tried adding and modifying helloworld web part to include react and ko libraries in the 'No javascript framework' template? That would be an interesting one to showcase how to use both and to mainly get to know if there any issues.
@StfBauer Stefan; understand you are questioning the wording used by the generator, but on the more general point I can't help think that if people feel the need for Knockout to do data binding on top of React then they're not getting the most out of React, where the model is not to data-bind at all but just re-render everything. But technically no reason you couldn't do it - just modify your React web part to take a dependency on KO as well.
@chakkaradeep Not sure on the internal implementation but as far as I have seen the new document library in Office 365 use both Kockout and React. Haven't digged deeper into what components are implemented with react and which are implemented using both or if they mix them up.
Overall it's more on the wording like Wictor said not on the technical implication.
@StfBauer - They are transitioning from knockout to react, so currently the host page is written in knockout, with the list control being written in React. That's a little different from what we have here. That said, it's not unusual to use multiple libraries, so we should account for that in the docs. I don't think we'd create a starting set of yourwebpart.ts files to handle each combination, but you should be able to start with any file, add the right references / etc. and get your code to work. You'll probably need to do some refactoring to have the code make sense though. Ie, with two-way data binding, you need to basically have a covering variable that you manually keep in sync with the webpart properties collection, while in react you tend to use the properties collection directly as the data store.
The text has been updated to "Which framework would you like to start with?" It isn't in Drop 2, but should be in the next one.
Closing old issues.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
If all uses cases are going to be covered then this list will be veeery long. You can always add/change framework at a later stage.
Keep it down to 2-3 options. Perhaps the wording could change, to "What framework would you like to start with"?