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

feat(javascript): add abtesting client, better init usage #784

Merged
merged 3 commits into from
Jul 5, 2022

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Jul 4, 2022

🧭 What and Why

🎟 JIRA Ticket:

Changes included:

The A/B Testing methods were previously available under the analytics client, but are now under their own client, so we need to provide it in algoliasearch.

We now:

  • Provide an initAbtesting method
  • Forward credentials to the init methods, already the case in v4, but we now also overriding.
  • Better parameter check, like in the other clients

The size impact is quite big, which is not ideal but also not a big deal for the global algoliasearch package.

🧪 Test

CI :D

@shortcuts shortcuts self-assigned this Jul 4, 2022
@netlify
Copy link

netlify bot commented Jul 4, 2022

Deploy Preview for api-clients-automation ready!

Name Link
🔨 Latest commit afc3c2a
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/62c3fb24af44b80009d61996
😎 Deploy Preview https://deploy-preview-784--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 Jul 4, 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 force-pushed the feat/js-algoliasearch-abtesting-dx branch from c8f2e0a to 4838a70 Compare July 4, 2022 15:45
@shortcuts shortcuts marked this pull request as ready for review July 4, 2022 15:49
@shortcuts shortcuts requested review from a team, damcou and millotp and removed request for a team July 4, 2022 15:49
@shortcuts shortcuts force-pushed the feat/js-algoliasearch-abtesting-dx branch from 22269a9 to 58edaff Compare July 4, 2022 15:52
millotp
millotp previously approved these changes Jul 5, 2022
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.

Looking great ! Feel free to ignore my comment

});
}

function initAbtesting(initOptions: CommonInitOptions & InitRegion<AbtestingRegion> = {}): AbtestingClient {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a way to make the Required<> or not correlated with the specs ? I guess it would be very hard

Copy link
Member Author

Choose a reason for hiding this comment

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

We could leverage the hasFallback logic but since each init are unique it would be the same as having it hardcoded :/

damcou
damcou previously approved these changes Jul 5, 2022
Copy link
Contributor

@damcou damcou left a comment

Choose a reason for hiding this comment

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

Makes sense, I trust both of you for the javascript side of things.

@shortcuts shortcuts dismissed stale reviews from damcou and millotp via afc3c2a July 5, 2022 08:49
@shortcuts shortcuts requested review from damcou and millotp July 5, 2022 08:52
@shortcuts shortcuts enabled auto-merge (squash) July 5, 2022 08:53
@shortcuts shortcuts merged commit 6b50ef0 into main Jul 5, 2022
@shortcuts shortcuts deleted the feat/js-algoliasearch-abtesting-dx branch July 5, 2022 09:04
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.

4 participants