Skip to content

Conversation

@kathmbeck
Copy link
Contributor

@kathmbeck kathmbeck commented Jan 27, 2026

🎉 Thanks for submitting a pull request! 🎉

Summary

To support the check here https://github.com/netlify/primitives/pull/577/changes


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@github-actions
Copy link
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@kathmbeck kathmbeck force-pushed the capabilities-site-info branch from 6cae54f to 0b53d6d Compare January 27, 2026 17:29
@kathmbeck kathmbeck requested a review from serhalp January 27, 2026 17:35
Comment on lines +156 to +161
const accounts = includeCapabilities
? ((await api.listAccountsForUser()) as MinimalAccount[] | null)
: ((await api.listAccountsForUser(
// @ts-expect-error(ndhoule): This is an unpublished, internal querystring parameter
{ minimal: 'true' },
)) as MinimalAccount[] | null)
Copy link
Member

@serhalp serhalp Jan 27, 2026

Choose a reason for hiding this comment

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

Discussed in Slack (internal link). In summary:

  • We had previously changed this to ?minimal=true and found that it had a very significant performance impact. To be fair, that was affecting all netlify-cli commands' startup times, even netlify help.
  • So, this will likely add up to many seconds of additional boot time to non-CLI code paths (those going through @netlify/dev, i.e. currently @netlify/vite-plugin and @netlify/nuxt).
  • It's a bit misleading for future us here that includeCapabilities results in computing and including several additional fields, one of which is capabilities. I think we can solve this easily with a different name.
  • Let's leave a comment here about how the perf difference is huge, to try to avoid future regressions?

Comment on lines +156 to +161
const accounts = includeCapabilities
? ((await api.listAccountsForUser()) as MinimalAccount[] | null)
: ((await api.listAccountsForUser(
// @ts-expect-error(ndhoule): This is an unpublished, internal querystring parameter
{ minimal: 'true' },
)) as MinimalAccount[] | null)
Copy link
Member

Choose a reason for hiding this comment

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

As Nathan called out, this type isn't accurate, right? We used to have an Account type, do we still have it? or does api.listAccountsForUser() maybe return the right type out of the box?

siteFeatureFlagPrefix: string
token: string
extensionApiBaseUrl: string
includeAccountCapabilities?: boolean
Copy link
Member

Choose a reason for hiding this comment

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

(see below) maybe something like:

Suggested change
includeAccountCapabilities?: boolean
includeFullAccountInfo?: boolean

or (note it's negated):

Suggested change
includeAccountCapabilities?: boolean
useMinimalAccountsApi?: boolean

@kathmbeck
Copy link
Contributor Author

Don't need this one anymore

@kathmbeck kathmbeck closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants