-
Notifications
You must be signed in to change notification settings - Fork 535
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
0.35 CRA-Demo Script and Feedback #5253
Comments
This demo is out of date. Please use the current demo found at aka.ms/fluid-cra Demo introductionIn this demo you will be doing the following:
1. Use Create-React-App with Typescriptnpx create-react-app my-app-name --use-npm --template typescript
cd my-app-name 2. Install Fluid and Fluid Data Objectsnpm install @fluid-experimental/fluid-static @fluid-experimental/data-objects * These are still experimental packages, and not ready for production Lastly, open up the 3. Import KVpair and Fluid StaticFluid gives you access to methods to boostrap a new Fluid container and attach DataObjects to it.
// App.tsx
import { Fluid } from "@fluid-experimental/fluid-static";
import { KeyValueDataObject, KeyValueInstantiationFactory } from "@fluid-experimental/data-objects"; 3.a Add the
|
Nice and easy to go through. A few things to mention on the walk through:
Then have them add the
Then have them fill in each
It might be better to just use Using more custom types is one of the things I've found that discourages people who may be new to those concepts. Especially those who come from a pure JavaScript background and haven't used TypeScript much. They tend to feel intimidated right upfront which ends up affecting everything they do in the walk through. After they get it going you could add an optional step at the end to enhance the return signature of Comments on the code:
To wrap up, really nice job on this so don't let my comments above infer otherwise. They're just suggestions that I think can potentially take it to the "next level". I really like the direction this is going. |
Managed to get it work without hassle, so pretty clear for me... Would like to see the same example using the @fluidframework/react though. Also is the KVPair suitable to sync/share large objects or should we use another DDS for that? |
@reinvanleirsberghe Thanks for the feedback! A few quick replies: KVPair is pretty unrefined at the moment. It's meant to be a quick, simple DO you can pick up and use for those 80% of the cases where you simply need to sync a bit of data in an app For larger data sets with more complicated APIs, I'd certainly recommend building your own purpose built DOs just like we did with KVPair. That process, and the challenge of picking the correct DDS for your type of data is beyond the scope of this demo, but certainly an were we hope to dig into in the future. The goal of this demo is, as a react developer, how am I supposed to interact with ANY DataObject, and how can we make that experience the best it can be. Thanks again for the feedback! |
Here's my feedback, by section, intentionally without having read any of the other comments or responses yet. (@SamBroner @ahmedbisht FYI.) 1)
2)
3)
3.a)
4)
5)
6)
NOTE: I have a feeling this will be one of the scariest things about this tutorial -- why on earth do we have to define the same data structure twice? This is probably also part of why I kept getting tripped up and failing to make it through understanding any of the previous Fluid React tutorials/documentation I've gone through. I can't tell you how many hours I've spent on trying to understand this issue and also why it's even an issue in the first place. :P
6.a)
6.b)
This should be included in the prior code snippet that tells the user what to insert. It's (evidently :)) too easy to gloss over the code snippet embedded in the short paragraph after the code snippet. 7)
7.a)
7.b)
8)
Summary2/5 stars, for at least being better than previous Fluid docs but still leaving me wishing I'd spent my Saturday differently. This even though I love the promise of Fluid and consider myself an expert-level developer/architect. I've actually built several real-time collaboration systems from scratch and did the equivalent of master's thesis research/work on the subject in a startup for two years. I'm going to keep at it because I'm extremely motivated, but unless Fluid provides more of its capabilities in a format that's at least somewhat adoptable by 200-level developers I can pretty much guarantee you it's not going to take off. I was hoping to be able to start an actual Fluid app today for a real-world business problem at our company (which my wife graciously gave me 5 hours of our weekend to do) and all I have to show for it is a single shared key-value in ~75 lines of code. 😢 |
Now that I've read some of the other feedback/responses, I feel even more strongly about my 2/5 star review.
I know that the changes I've asked for (like having a single I think part of the problem is that most of the Fluid examples I've come across, including this one, only ever show a single property, rather than an actual app. Maybe I'm just missing something and the APIs actually start to compose really well once you scale up from this point, but I don't see how that's possible. Consider Redux, widely regarded as one of the most complex things you can do in React but also very widely adopted. The number of lines of code to create a shared model, reducers, etc. is 20 or less, and most of that is the user's data -- not using/composing framework APIs that the user has to learn. Once that is in place, it's ~5-10 lines of code to add a new property, reducer, etc. Fluid is clocking in at 60+ LOC for a single shared value, most of which is highly intricate API composition that requires extreme attention to detail (there are some very nuanced things to consider in the hooks code in the sample above, as you call out in the supporting explanations), and there's no clear way to see that the next data object/type I want to add to my app won't also require that same level of effort since none of that code appears to be reusable in its current form. |
@LarsKemmann , thank you for taking the time to both go through our tutorial, and write such a thorough critique. We both need it and appreciate it greatly. Feedback is critical to our progress, and hopefully with iteration we can eventually arrive at least at a 4/5 star review. 😊 For context, this tutorial is a first step in a larger effort and hopefully I can provide a bit more framing around our thinking. The Fluid Framework has a ton of raw power and is designed to be a base layer for building complex real-time applications. This power comes at the cost of complexity through abstractions. When developing the first versions of the framework one of our core principals was to provide the users (usually ourselves) the option to do whatever they wanted, wherever they wanted. This produced the foundation of the modern core framework and enables a lot of the complex (1000 level) scenarios we have within Microsoft. But abstraction comes at the price simplicity. When you can do everything you can't easily do anything. We have historically been in the mindset that developers will build within some form of the Fluid ecosystem. There is a lot of benefits you get from building within the framework that we really want to bring to developers. This, "in the framework model," is apparent in our current HelloWorld experience that involves the developer building then consuming their DataObject. We've found, as you have, this is way to heavy for developers getting started. Lots of concepts to solve a simple problem like a dice roller. To make it easier for developer we are focusing on providing pre-built DataObjects that developers only have to consume. What you are seeing here is the initial attempt at providing this model of DataObject consumption. This consumption model is a focused on the Fluid Framework being a Data+API layer in your webstack toolkit, and we have three primary principals that guide our decision making.
We are working to strike the balance is between simplicity for 100-200 level developers and depth for 300+ level developers. As you've pointed out we are still missing the mark on both and this is where community feedback and iteration is so critical. Your comments around reducing the number of concepts and specifically removing factory concepts is on our radar and something we will be addressing. Your comments around spending 5 hours and ending up with a single shared key-value in particular makes me very sad. We have support for alternate DataObjects and DataObject composition on our radar but your comment brings up other thoughts. We need to do a better job setting expectations for these types of engagements and specifically what we expect a developer to be able to do with the end product. This is definitely a simple 100 level learning tutorial with no path higher application and it should be represented that way. The other difficult problem we are trying to solve for is scenario story telling from 100 to 200 to 300+ level developers. No developer will build an entire website with a collaborative dice roller but as begin to consider real applications we believe strongly that developers need to be able to bring web-technologies that work best for them. The tradeoffs here are similar to paragraph above but with a focus on ensuring someone who writes a 100 level application doesn't need to re-write their code to take advantage of depth within the framework. Considering the breadth of features the framework has, and the different points of integration, keeping the right amount of depth available to developers is a challenge. Finally I want to talk about view frameworks. The idea of a @fluidframework/react package is something we've considered on multiple occasions. We actually have an existing package already that does this but has not been worked on in a while. As I mentioned above we've taken a strong focus on Fluid being the Data+API layer of the webstack. This is intentional because as a very small team working on developer experiences we believe that in order to make Fluid world class we need to first focus on the fundamentals. But, we also recognize that data in itself is not very exciting. We need to empower developers to build applications which means we need to embrace web technologies and integrate well with view frameworks. Kind of a chicken and egg problem we have here. The strong feedback I'm getting here is a need to understand the pieces and what is within your control as a developer. As an professional developer you should be able to walk away from this and say "I get how I could integrate this into my application." Instead you are asking why we even expose it. We cannot teach every scenario and we need to get to a state where developers can learn concepts that they can apply to their unique scenarios. Finally, you've included a lot of pointed actionable feedback around both technical improvements and storytelling. I'll make sure these are included in our planning. If you feel particularly passionate about any issues please make sure your log an Issue. Thanks again for taking time on your weekend. I've learned a lot and look forward to future engagements! 😊 |
@micahgodbolt Thanks for putting this tutorial together. I followed the tutorial and was able to get the app working. I think this is a great step towards making Fluid much easier to use and integrate in React apps. Where the steps clear? I do think more information could be provided on why we were using certain Fluid APIs, methods, enums etc. Overall, I think it is more important to focus on the Fluid API itself vs how the React APIs work. For example, it would be great to add information on what
Impression on Approach: Other thoughts
For the point of this tutorial, I think the app we built makes sense, but to make Fluid more appealing I think a more interesting example would be more fun :) I'm looking forward to using the experimental packages soon! |
|
@reinvanleirsberghe thanks for the reminder. Several things actually changed and my plan was to close this issue now that the 0.36 demo is out. |
@fluid-example/cra-demo 0.35 release
Follow the tutorial then leave comments below
We'll repeat this process with future releases
* This demo is a work in progress. There will be rough sections that need refactoring or refinement
The text was updated successfully, but these errors were encountered: