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

Stubbed out branching example #23595

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

ChumpChief
Copy link
Contributor

Adds a new example package for the branching feature. For now, just "fakes" branching, to be filled in as the feature develops. But in the meantime it's useful for thinking through what the customer interaction and app integration pieces could possibly look like.

@github-actions github-actions bot added area: examples Changes that focus on our examples dependencies Pull requests that update a dependency file base: main PRs targeted against main branch labels Jan 17, 2025

Choose a reason for hiding this comment

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

Copilot reviewed 15 out of 30 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • examples/apps/branching/.gitignore: Language not supported
  • examples/apps/branching/.npmignore: Language not supported
  • examples/apps/branching/LICENSE: Language not supported
  • examples/apps/branching/biome.jsonc: Language not supported
  • examples/apps/branching/package.json: Language not supported
  • examples/apps/branching/src/index.html: Language not supported
  • examples/apps/branching/src/start.ts: Evaluated as low risk
  • examples/apps/branching/src/model/index.ts: Evaluated as low risk
  • examples/apps/branching/src/model/groceryList.ts: Evaluated as low risk
  • examples/apps/branching/src/view/debugView.tsx: Evaluated as low risk
  • examples/apps/branching/prettier.config.cjs: Evaluated as low risk
  • examples/apps/branching/src/view/groceryListView.tsx: Evaluated as low risk
  • examples/apps/branching/src/modelInterfaces.ts: Evaluated as low risk
  • examples/apps/branching/src/healthBot.ts: Evaluated as low risk
  • examples/apps/branching/jest-puppeteer.config.cjs: Evaluated as low risk
Comments suppressed due to low confidence (2)

examples/apps/branching/src/model/containerCode.ts:18

  • [nitpick] The variable name 'groceryListId' is too similar to 'groceryListRegistryKey'. Consider renaming it to 'groceryListDataStoreId' for clarity.
const groceryListId = "grocery-list";

examples/apps/branching/src/model/containerCode.ts:19

  • [nitpick] The variable name 'groceryListRegistryKey' is too similar to 'groceryListId'. Consider renaming it to 'groceryListRegistryEntryKey' for clarity.
const groceryListRegistryKey = "grocery-list";
return branchedMap;
};

const branch = async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fake branching here. I think it should be fairly straightforward to integrate @anthony-murphy 's prototype here AFAICT, but I haven't actually tried.

const branchedMap = branchMap(map);
// TODO: Should there be a working handle here? What would that mean?
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
return new GroceryList(runtime, {} as IFluidHandle<FluidObject>, branchedMap, () => {
Copy link
Contributor Author

@ChumpChief ChumpChief Jan 17, 2025

Choose a reason for hiding this comment

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

Note that I'm creating a whole second data store class instance (GroceryList) rather than just a second map. This seems easier to integrate into the view layer since I can just reuse the existing GroceryListView and don't have to make that view branch-aware. And also the data store itself doesn't have to be particularly knowledgeable about its branched state.

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> [email protected] ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> [email protected] serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> [email protected] check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  170508 links
    1603 destination URLs
    1842 URLs ignored
       0 warnings
       0 errors


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Changes that focus on our examples base: main PRs targeted against main branch dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant