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

Deep dive for ICodeLoader #8193

Closed
7 tasks done
scottn12 opened this issue Nov 9, 2021 · 8 comments
Closed
7 tasks done

Deep dive for ICodeLoader #8193

scottn12 opened this issue Nov 9, 2021 · 8 comments
Assignees
Labels
ado Issue is tracked in the internal Azure DevOps backlog api deprecation Changes to a deprecated API epic An issue that is a parent to several other issues
Milestone

Comments

@scottn12
Copy link
Contributor

scottn12 commented Nov 9, 2021

Overview

The motivation to move ICodeLoader interface outside the container-definition is to separate abstractions layers. The @fluidframework/container-definition#ICodeLoader interface loads the package specified by code details and returns a promise to its entry point exports. @fluidframework/container-loader#ICodeDetailsLoader also performs the same functionality.

Affected Repositories:

Bohemia, Whiteboard, Fluid Framework

Files Affected

Fluid Framework:

  1. common\lib\container-definitions\src\loader.ts
  2. examples\hosts\iframe-host\src\inframehost.ts
  3. packages\loader\container-loader\src\containerContext.ts
  4. packages\loader\container-loader\src\loader.ts
  5. packages\loader\web-code-loader\src\webLoader.ts
  6. packages\test\test-utils\src\localCodeLoader.ts
  7. packages\test\test-utils\src\localLoader.ts
  8. packages\tools\replay-tool\src\replayLoaderObject.ts
  9. server\routerlicious\packages\services\src\nodeCodeLoader.ts

Proposed Replacement

Remove ICodeLoader from @fluidframework/container-definitions. Replace ICodeLoader with ICodeDetailsLoader by importing it from @fluidframework/container-loader.

Issues

Next

@ChumpChief
Copy link
Contributor

Re: Phase 1, I think probably the ICodeDetailsLoader interface and IFluidModuleWithDetails interface should be moved to the @fluidframework/container-definitions package, and then @fluidframework/container-loader and downstream customers can import from there instead. So that might be a Phase 0.

Now that I'm looking at it, I'm also thinking it would probably make more sense for basically all the stuff in fluidPackage.ts under @fluidframework/core-interfaces to move and be split between @fluidframework/container-definitions and @fluidframework/container-loader. Because code details, code loading, modules, etc. are not really "core" but rather specific to the container and its load flow. Currently these functionalities have their interfaces split between core-interfaces and container-definitions rather than a single package, and I don't understand why. If folks agree, now might be an opportune time to consolidate everything under container-definitions.

Also @anthony-murphy for visibility and his opinions.

@ChumpChief
Copy link
Contributor

I see that fluidPackage.ts used to be in container-definitions until a little over a year ago with #3835 which moved it to core-interfaces, so it seems this move was intentional? But I still don't understand.

@anthony-murphy
Copy link
Contributor

That seems fine. In retrospect that move looks like a mistake.

we are not there today, but i view our current common definitions as the place where we specify layer crossing contracts. The layers being: server, driver, host (loader), runtime, datastore, dds

The code loader is interesting, as it is not layer crossing itself. it is only a host concept, but we don't really have a great place to define and interface like that, as putting it in container-loader also brings all the implementations, making it hard for partners to structure their host code in a reusable way. I don't think that changes anything today, and container-definitions is probably the right place for it. But long term i could see leaf level definition packages that pair with implementation but include things that don't cross layers. The problem or course being package and version proliferation, but i think there are things we can do that ease that which i explore a bit in #6540.

@sonalivdeshpande
Copy link
Contributor

That seems fine. In retrospect that move looks like a mistake.

we are not there today, but i view our current common definitions as the place where we specify layer crossing contracts. The layers being: server, driver, host (loader), runtime, datastore, dds

The code loader is interesting, as it is not layer crossing itself. it is only a host concept, but we don't really have a great place to define and interface like that, as putting it in container-loader also brings all the implementations, making it hard for partners to structure their host code in a reusable way. I don't think that changes anything today, and container-definitions is probably the right place for it. But long term i could see leaf level definition packages that pair with implementation but include things that don't cross layers. The problem or course being package and version proliferation, but i think there are things we can do that ease that which i explore a bit in #6540.

@anthony-murphy, if I have understood this correctly and container-definitions is the right place for ICodeLoader interface, then should the deprecated tag be removed from ICodeLoader? And why are we using the new interface @fluidframework/container-loader#ICodeDetailsLoader?

@ChumpChief
Copy link
Contributor

ICodeLoader is still correctly deprecated and should still get removed -- but basically all the other code-loading-related interfaces should also move into container-definitions (including ICodeDetailsLoader, and all the stuff in fluidPackage.ts).

@sonalivdeshpande
Copy link
Contributor

@anthony-murphy, @ChumpChief updated the Methodology to have four phases. Please take a look at it once. Thanks!

@ChumpChief
Copy link
Contributor

Looks good to me!

@skylerjokiel skylerjokiel modified the milestones: March 2022, April 2022 Apr 4, 2022
@heliocliu heliocliu modified the milestones: April 2022, Next Apr 5, 2022
@heliocliu heliocliu added the epic An issue that is a parent to several other issues label Apr 5, 2022
@skylerjokiel skylerjokiel added the ado Issue is tracked in the internal Azure DevOps backlog label May 20, 2022
@skylerjokiel
Copy link
Contributor

Moved to ADO

Repository owner moved this from In Progress to Done in Fluid DevX May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ado Issue is tracked in the internal Azure DevOps backlog api deprecation Changes to a deprecated API epic An issue that is a parent to several other issues
Projects
Status: Done
Development

No branches or pull requests

7 participants