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(instantsearch): update usage errors #3543

Merged
merged 3 commits into from
Feb 25, 2019

Conversation

francoischalifour
Copy link
Member

This updates the InstantSearch errors, links to the new documentation and add tests.

@francoischalifour francoischalifour requested a review from a team February 18, 2019 12:20
@algobot
Copy link
Contributor

algobot commented Feb 18, 2019

Deploy preview for instantsearchjs ready!

Built with commit 8e4d858

https://deploy-preview-3543--instantsearchjs.netlify.com

src/lib/InstantSearch.js Outdated Show resolved Hide resolved
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.

a couple of comments/questions but looks good 👍

@francoischalifour
Copy link
Member Author

I applied changes and created short links that guide to the documentation.

throw new Error('Widget definition missing render or init method');
throw new Error(`The widget definition expects a \`render\` and/or an \`init\` method.

See: http://alg.li/isjs-custom-widgets`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think this is going to be hard to manage if the page in the doc gets moved or refactored.
Short is good for bandwidth but it's even harder to grep through pages we moved in the docs now that they are shortened.

Copy link
Member Author

Choose a reason for hiding this comment

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

At some point we need to make a decision. We've discussed many approaches and didn't come to a conclusion yet.

(1) If we start adopting the shorten-URL pattern, we need to educate the team to connect to short.cm and create a shorter URL. We don't need to update the source code if the link changes but only in the short.cm dashboard. Another negligible plus is that the links are shorter and therefore the bundle size get's slightly lighter.

(2) If we inline all the links, we need to update the source code whenever a link breaks (this was the initial solution of this PR).

(3) If we don't include links, errors are completely meaningless for the users.

I don't mind going for either (1) or (2).

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed with you Francois, and the links are easiest. Maybe later some way to make it more automatic (e.g. generated from some GitHub file or something, but that wouldn't change too much IMO)

@francoischalifour
Copy link
Member Author

I updated the links to their raw origin (not shortened), waiting for a better strategy for storing and detecting broken links (cc @tkrugg).

@francoischalifour francoischalifour merged commit a2a800b into develop Feb 25, 2019
@francoischalifour francoischalifour deleted the fix/instantsearch-usage-errors branch February 25, 2019 15:30
francoischalifour added a commit that referenced this pull request Mar 14, 2019
### Bug Fixes

* **instantsearch:** update usage errors ([#3543](#3543)) ([a2a800b](a2a800b))
* **searchBox:** add reusable SearchBox component ([#3489](#3489)) ([c073a9a](c073a9a))

### Features

* **panel:** implement collapsed feature ([#3575](#3575)) ([e84b02b](e84b02b))

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Thu Mar 14 13:53:06 2019 +0100
#
# On branch master
# Your branch is ahead of 'origin/master' by 54 commits.
#   (use "git push" to publish your local commits)
#
# Changes to be committed:
#	modified:   CHANGELOG.md
#	modified:   package.json
#	modified:   src/lib/version.js
#
francoischalifour added a commit that referenced this pull request Mar 18, 2019
## [3.2.1](v3.1.0...v3.2.1) (2019-03-18)

### Bug Fixes

* **connectToggleRefinement:** keep user provided, but falsy values ([#3526](#3526)) ([958a151](958a151))
* **instantsearch:** update usage errors ([#3543](#3543)) ([a2a800b](a2a800b))
* **panel:** append panel body as a child element ([#3561](#3561)) ([3de59a3](3de59a3))
* **poweredBy:** remove TypeScript extension in import ([#3530](#3530)) ([99ecc0b](99ecc0b)), closes [#3528](#3528)
* **release:** update doctoc script ([e07c654](e07c654))
* **searchbox:** unmount component on dispose ([#3563](#3563)) ([c3f0435](c3f0435))
* **searchBox:** add reusable SearchBox component ([#3489](#3489)) ([c073a9a](c073a9a))

### Features

* **panel:** implement collapsed feature ([#3575](#3575)) ([e84b02b](e84b02b))
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