-
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
FluidStatic collection of changes #5459
FluidStatic collection of changes #5459
Conversation
…to fluid-init-pattern
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.
I think this is great. This is really close to our original conversations and code samples from December/Jan.
Curious why you left it in? Is it one of those, "I'm pretty sure this is useful, but I can't articulate why yet, but I just know it" things? |
It lets you have multiple service connections |
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.
Will keep looking after meeting
Co-authored-by: Tyler Butler <tyler@tylerbutler.com>
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 started off with me just wanted to get my hands on the code but ended up with some changes I really liked.
Bring server declaration to the global level
It seemed heavy to declare the server every time you wanted to create a container object. By creating an init and moving the server declaration to the global scope we follow similar server initialization frameworks and can tell an easier story about server connection. If the developer does want to connect to more than one server see bullet 6.
get/create container takes an object config instead of properties
Object configs will allow developer to pre-build their container configs. This will be helpful in scenarios where developers have one server with multiple container types. We haven't seen it yet but our examples basically end at dice-roller. Ex. I could imagine a developer building a game website where they have two games and the container definition will be different depending on the game the user chooses.
Export Fluid as a default from the FluidStatic package.
default export is usually frowned upon but for scenarios where your entire goal is to have one package dedicated to one thing it makes sense.
Add support for static DataObject creation on container create
Developers can now declare an string to DO mapping of initial dataObjects
Add runtime checks to validate user intent
I've added some runtime checks to help the developer out:
Support instances of the top level Fluid global object
The FluidInstance class allows the developer to not use the global Fluid object in the Fluid static project and instead create managed instances that target specific servers. This is a very advanced scenario and I don't currently have a scenario for it.
get/create DataObject now have strong typing
Developer must provide a type that extends the DataObject class when getting or creating DataObjects