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(widgets): annotate widget instances with $$widgetType #4624

Merged
merged 10 commits into from
Jan 19, 2021

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jan 12, 2021

Adds a new $$widgetType to all widgets, so they can be differentiated from connectors, as well as differentiating between widgets that share a connector.

This differentiation hasn't been done for rangeInput & rangeSlider yet

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 12, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d05e693:

Sandbox Source
InstantSearch.js Configuration

@Haroenv Haroenv force-pushed the poc/telemetry5 branch 2 times, most recently from c8f19b7 to 7d06cbc Compare January 13, 2021 14:19
@Haroenv Haroenv changed the title POC: widgetType annotation feat(widgets): annotate widget instances with $$widgetType Jan 13, 2021
@Haroenv Haroenv force-pushed the poc/telemetry5 branch 2 times, most recently from e24b401 to aebaf52 Compare January 13, 2021 15:06
@Haroenv Haroenv marked this pull request as ready for review January 13, 2021 15:06
@Haroenv Haroenv force-pushed the poc/telemetry5 branch 2 times, most recently from 240b49f to ca93e85 Compare January 14, 2021 14:03
@Haroenv Haroenv requested a review from yannickcr January 14, 2021 14:07
@Haroenv Haroenv force-pushed the poc/telemetry5 branch 3 times, most recently from b345e49 to 1fa70b8 Compare January 15, 2021 10:59
src/lib/utils/typedObject.ts Outdated Show resolved Hide resolved
@@ -50,6 +51,7 @@ function extractPayload(

payload.widgets.push({
type: widget.$$type,
widgetType: widget.$$widgetType,
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly widget.$$type is the connector type and widget.$$widgetType is the actual widget type, is that right ?

If that the case maybe it would be clearer to rename type to connectorType in the payload ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

widgets without a connector (index, analytics) technically set type too, which is why I didn't rename it to connectorType :)

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we clean up the types for widgets without a connector? Is it a good time to do so? No strong opinion, but genuinely asking.

@Haroenv Haroenv requested a review from yannickcr January 15, 2021 15:09
package.json Outdated Show resolved Hide resolved
src/types/widget.ts Outdated Show resolved Hide resolved
src/types/widget.ts Outdated Show resolved Hide resolved
src/widgets/__tests__/index.tests.ts Outdated Show resolved Hide resolved
src/widgets/__tests__/index.tests.ts Show resolved Hide resolved
src/widgets/__tests__/index.tests.ts Show resolved Hide resolved
Copy link
Contributor

@eunjae-lee eunjae-lee 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 to me!

Base automatically changed from poc/telemetry4 to master January 19, 2021 12:30
@Haroenv Haroenv merged commit df3f478 into master Jan 19, 2021
@Haroenv Haroenv deleted the poc/telemetry5 branch January 19, 2021 12:37
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