Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(ua): change the User-Agent to use the new specs lib (version) #481

Merged
merged 14 commits into from
Apr 17, 2019

Conversation

robertmogos
Copy link
Contributor

@robertmogos robertmogos commented Mar 22, 2019

Summary
Update UA to angular ($VERSION); angular-instantsearch ($VERSION)

Add the addAlgoliaAgent to SearchClient and fix the issue where the UA is only added when the SearchClient is not passed in config

Result

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

This will also need some tests.

src/create-ssr-algolia-client.ts Show resolved Hide resolved
@algobot
Copy link

algobot commented Mar 22, 2019

Deploy preview for angular-instantsearch ready!

Built with commit be8e039

https://deploy-preview-481--angular-instantsearch.netlify.com

src/create-ssr-algolia-client.ts Show resolved Hide resolved
@algobot
Copy link

algobot commented Mar 22, 2019

Deploy preview for angular-instantsearch ready!

Built with commit 046be61

https://deploy-preview-481--angular-instantsearch.netlify.com

@algobot
Copy link

algobot commented Mar 22, 2019

Deploy preview for angular-instantsearch ready!

Built with commit 2fc3318

https://deploy-preview-481--angular-instantsearch.netlify.com

@francoischalifour
Copy link
Member

Before approving, this should be tested for both client and server versions.

@robertmogos robertmogos requested a review from samouss March 26, 2019 13:59
@robertmogos
Copy link
Contributor Author

Before approving, this should be tested for both client and server versions.

@francoischalifour Tested both on client and server:

Netlify:
angular (7.0.1);angular-instantsearch (2.2.1)

SSR:
angular-instantsearch (2.2.1);angular-instantsearch-server (2.2.1);

@Haroenv
Copy link
Contributor

Haroenv commented Mar 26, 2019

looks like SSR is missing the Angular version then?

@robertmogos
Copy link
Contributor Author

robertmogos commented Mar 26, 2019

looks like SSR is missing the Angular version then?

@Haroenv I didn't added it since in create-ssr-algolia-client.ts there is no import related to Angular. Should I add it ?

import * as algoliasearchProxy from 'algoliasearch/index';
import * as encodeProxy from 'querystring-es3/encode';
import { VERSION } from './version';

@Haroenv
Copy link
Contributor

Haroenv commented Mar 27, 2019

It would seem useful to know for me:

import {
   VERSION as AngularVersion,
 } from '@angular/core';

@Haroenv
Copy link
Contributor

Haroenv commented Mar 27, 2019

Looks like prettier wants the imports inlined. Also there are no tests for this, and they probably should be added

Copy link
Contributor

@tkrugg tkrugg left a comment

Choose a reason for hiding this comment

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

Looks ready to merge 💯
Please refrain from merging if you can't release this yet, just so we don't block other feature.

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

It doesn't seem to have a test for the client side.

@robertmogos
Copy link
Contributor Author

It doesn't seem to have a test for the client side.

I added the client side UA + thanks to @tkrugg we spot a bug where the UA was only added when the SearchClient was not provided in the config. I added too the addAlgoliaAgent: (agent: string) => void; method to the SearchClient

src/instantsearch/instantsearch.ts Outdated Show resolved Hide resolved
src/instantsearch/instantsearch.ts Show resolved Hide resolved
src/instantsearch/instantsearch.ts Outdated Show resolved Hide resolved
@samouss samouss dismissed their stale review April 17, 2019 07:30

Feedback applied.

Co-Authored-By: samouss <samuel.vllnt@gmail.com>
@samouss samouss merged commit 9046bf3 into develop Apr 17, 2019
@samouss samouss deleted the fix/user-agent branch April 17, 2019 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants