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

Multiclient in modular support #1830

Merged
merged 56 commits into from
Jul 25, 2023
Merged

Conversation

qiaozha
Copy link
Member

@qiaozha qiaozha commented Apr 26, 2023

This PR is mainly focus on how to implement multiple subclients in the Modular library and see the design https://github.com/Azure/azure-sdk-for-js/pull/26164/files

And the following items are non-goals of this PR:

  1. multiple endpoints scenario in RLC layer. Issue tracked [DPG]Multi-Endpoint support in Modular #1894
  2. identify the shared models and only generate it once. See more details in this issue https://github.com/Azure/typespec-azure/issues/3035
  3. Split the RLC layer from Modular.

In this packages/typespec-test/test/loadtesting_modular smoke test case, we have two subclients LoadTestRunClient and LoadTestAdministrationClient in the Modular layer, and they both point to the same @service, which means the RLC layer is single endpoint.

our current code structure is
image

On the subpath exports, we export the following subpaths

   "exports": {
    ".": {
      "types": "./types/src/index.d.ts",
      "require": "./dist/index.cjs",
      "import": "./dist-esm/src/index.js"
    },
    "./loadTestAdministration": {
      "types": "./types/src/loadTestAdministration/index.d.ts",
      "import": "./dist-esm/src/loadTestAdministration/index.js"
    },
    "./loadTestAdministration/api": {
      "types": "./types/src/loadTestAdministration/api/index.d.ts",
      "import": "./dist-esm/src/loadTestAdministration/api/index.js"
    },
    "./loadTestAdministration/models": {
      "types": "./types/src/loadTestAdministration/models/index.d.ts",
      "import": "./dist-esm/src/loadTestAdministration/models/index.js"
    },
    "./loadTestRun": {
      "types": "./types/src/loadTestRun/index.d.ts",
      "import": "./dist-esm/src/loadTestRun/index.js"
    },
    "./loadTestRun/api": {
      "types": "./types/src/loadTestRun/api/index.d.ts",
      "import": "./dist-esm/src/loadTestRun/api/index.js"
    },
    "./loadTestRun/models": {
      "types": "./types/src/loadTestRun/models/index.d.ts",
      "import": "./dist-esm/src/loadTestRun/models/index.js"
    }
  },

Based on our latest discussion, "We only need one way to import these things without there being ambiguity about which way is correct". I have removed the top level api/index.ts and models/index.ts in the multi-client modular case.

Remove ./rest subpath export as discussed in the Q&A session.

qiaozha

This comment was marked as outdated.

@qiaozha

This comment was marked as outdated.

Copy link
Member Author

@qiaozha qiaozha left a comment

Choose a reason for hiding this comment

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

Still have a few places to improve.

Copy link
Member Author

@qiaozha qiaozha left a comment

Choose a reason for hiding this comment

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

Left some comments, hope this can accelerate the review.

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

A couple thoughts

@qiaozha
Copy link
Member Author

qiaozha commented Jul 19, 2023

@xirzec @mpodwysocki I have removed the top level api/index.ts and models/index.ts in the multi clients case. Could you help review again and let me know if you have any comments ? Thanks

@qiaozha
Copy link
Member Author

qiaozha commented Jul 21, 2023

Pending on #1933 to be fixed.

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.

6 participants