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

fix(javascript): remove factory from build #639

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

shortcuts
Copy link
Member

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-506

Changes included:

We were exposing the factory function in the final build, which could be confusing for a user when importing the client using IDE autocompletion.

We now move the method props to a clientMethodProps model file.

Side changes:

  • Bump bundlesize due to previous changes
  • Re-export version of the search client for algoliasearch
  • Export return type of the algoliasearch client

🧪 Test

CI :D

@shortcuts shortcuts self-assigned this Jun 6, 2022
@netlify
Copy link

netlify bot commented Jun 6, 2022

Deploy Preview for api-clients-automation ready!

Name Link
🔨 Latest commit aa8e159
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/629de4dcb8ce7b00089b4388
😎 Deploy Preview https://deploy-preview-639--api-clients-automation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@algolia-bot
Copy link
Collaborator

algolia-bot commented Jun 6, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

@shortcuts shortcuts requested review from a team, eunjae-lee and millotp and removed request for a team June 6, 2022 11:28
@shortcuts shortcuts marked this pull request as ready for review June 6, 2022 11:28
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

Looks good !

Comment on lines +26 to +35
{{#operations}}
import type {
{{#operation}}
{{#vendorExtensions.x-create-wrapping-object}}
{{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Props,
{{/vendorExtensions.x-create-wrapping-object}}
{{/operation}}
} from '../model/clientMethodProps';
{{/operations}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

import * is not enough here ?

Copy link
Member Author

@shortcuts shortcuts Jun 6, 2022

Choose a reason for hiding this comment

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

If we give it an alias we would have to change all methods to use Alias.TypeName so I thought it was less verbose to do it at the import level, wdyt?

@shortcuts shortcuts merged commit 2a1f30c into main Jun 6, 2022
@shortcuts shortcuts deleted the fix/js-remove-factory-from-build branch June 6, 2022 12:15
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.

None yet

3 participants