Skip to content
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

Merged
merged 13 commits into from
Mar 11, 2021

Conversation

skylerjokiel
Copy link
Contributor

@skylerjokiel skylerjokiel commented Mar 10, 2021

This started off with me just wanted to get my hands on the code but ended up with some changes I really liked.

  1. Bringing server declaration to the global level
  2. get/create container takes a config instead of properties
  3. Export Fluid as a default from the FluidStatic package.
  4. Add support for static dataObject creation on container create
  5. Add runtime checks to validate user intent
  6. Support instances of the top level Fluid global object
  7. get/create DataObject now have strong typing

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:

  • DO declaration to ensure there are not two DO with the same type
  • DO creation validates that there is a DO in the registry
  • Container cannot be initialized without DOs
  • Global init must happen before creating/getting a container

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

Copy link
Contributor

@SamBroner SamBroner left a 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.

@tylerbutler
Copy link
Member

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.

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?

@SamBroner
Copy link
Contributor

SamBroner commented Mar 10, 2021

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.

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

Copy link
Contributor

@ChumpChief ChumpChief left a 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

@skylerjokiel skylerjokiel reopened this Mar 10, 2021
@github-actions github-actions bot requested a review from ChumpChief March 10, 2021 20:50
Co-authored-by: Tyler Butler <tyler@tylerbutler.com>
Copy link
Member

@tylerbutler tylerbutler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@skylerjokiel skylerjokiel merged commit 4e9c011 into microsoft:main Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants