Skip to content

polar: Move away from inline imports#10975

Draft
Yopi wants to merge 1 commit intomainfrom
yopi/polar-self-client
Draft

polar: Move away from inline imports#10975
Yopi wants to merge 1 commit intomainfrom
yopi/polar-self-client

Conversation

@Yopi
Copy link
Copy Markdown
Contributor

@Yopi Yopi commented Apr 14, 2026

We want to avoid loading the entire SDK, because it doesn't get lazily loaded, but having inline imports in every method does not look great either.

By splitting the client and implementation like this, we can get code that is a bit nicer to read without getting a memory footprint in the cases where we dont want it.

We want to avoid loading the entire SDK, because it doesn't get lazily loaded,
but having inline imports in every method does not look great either.

By splitting the client and implementation like this, we can get code
that is a bit nicer to read without getting a memory footprint in the
cases where we dont want it.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
polar Ready Ready Preview, Comment Apr 14, 2026 11:41am
polar-sandbox Ready Ready Preview, Comment Apr 14, 2026 11:41am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

OpenAPI Changes

No changes detected in the OpenAPI schema.

@github-actions
Copy link
Copy Markdown
Contributor

Preview Environment
URL: https://polar-preview-vm.taildbff7b.ts.net/pr-10975
API: https://polar-preview-vm.taildbff7b.ts.net/pr-10975/v1/
Logs: backend
SHA: 60b1898bf2546a805e885d45f2b8ec35da3c4537

@frankie567
Copy link
Copy Markdown
Member

Looks smart :) That said, if I'm not mistaken, Speakeasy supports TypedDict as well... So we could do, still with proper type checking:

                await self._sdk.members.create_member_async(
                    request={
                        "customer_id": customer_id,
                        "email": email,
                        "name": name,
                        "external_id": external_id,
                    }
                )

And avoid to load heavy Pedantic models. WDYT?

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.

2 participants