-
Notifications
You must be signed in to change notification settings - Fork 557
InstantSearch.js v3 #3264
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
Merged
Merged
InstantSearch.js v3 #3264
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat(range-input): rename attribute option * feat(range-input): rename CSS classes * feat(range-input): update markup * docs(migration): add migration * feat(stats): apply changes * docs(migrations): fix CSS * feat(stats): remove `currency` class
* feat(stats): apply v3 specs * docs(migration): add migration * feat(stats): remove autoHideContainer * feat(stats): rename component
* feat(hits): apply v3 spec * docs(migration): add migration * feat(hits): apply changes
* feat(menuSelect): implement is.css * fix(dev-novel): update new options for menu-select * fix(menu-select): correct case for widget name in class name * fix(menu-select): leverage template for options * feat(menu-select): fix markup to use Template and generalize classnames * fix: use plural for seeAllOption
* docs(migration): clearRefinements migration\ * refactor: clearAll -> clearRefinements * fix(clearRefinements): excludeAttributes -> excludedAttributes * feat(ClearRefinements): update markup for is.css * feat(clearRefinements): new options * docs(clearRefinements): provide initial refinements in dev-novel * test: consistent testing with description * chore: ClearRefinements all the things * fix: replace black / white lists with better names * chore: cleanup autoHideContainer related options * doc: wording for getRefinements and clearRefinemetns jsDoc
* feat(pagination): apply changes * docs(migrations): add widget * feat(pagination): add stories
* feat(sort-by): apply changes * feat(sort-by): rename widget * feat(migration): add widget
* feat(price-ranges): remove widget * docs(migration): update migration
* feat(hits-per-page): apply changes * feat(hits-per-page): update Selector component * feat(hits-per-page): rename widget * feat(hits-per-page): update story import * docs(migration): update migration
* feat(highlight): add highlight helper * feat(highlight): add Hits stories * feat(highlight): rename helper story * test(utils): test getPropertyByPath * refactor(highlight): use Regex literals * test(hits): test highlight with hits * test(utils): add test for getPropertyByPath * feat(highlight): throw error if uncorrect format * refactor(helpers): create helpers folder * feat(highlight): replace <em> by <mark> * fix(Hits): fix highlight import * chore(refinement-list): remove ESLint statement
* Update source code * Update documentation * Update README * Update demos * Update community website
We used to have named exports because we exposed `RawComponent` in addition to `Component` as a default export. We don't anymore since we dropped the `AutoHideContainer`.
Disable functional tests during the development of `feat/3.0` so that Travis passes. It's currently broken because of some new markup.
* feat(snippet): add snippet helper * feat(hits): add snippet stories * feat(snippet): export function snippet * fix(snippet): rename snippet function
* feat(Geo): update classes * feat(Geo): update template * docs(Geo): add migration * chore: update InstantSearch.css to 7.1.0 * fix(geo): update key names * refactor(Geo): use object notation for cx
This disables setting the `url` from the widget `poweredBy`, but only from the connector.
## Migrate from Webpack to Rollup
Rollup is now used to bundle InstantSearch.js. Rollup is more suited for libraries. It allows us to create lighter bundles and multiple bundle strategies.
| | Webpack | Rollup
|---|---|---
| Bundle | 372 kB | 301 kB
| GZipped | 97 kB | 84 kB
This sizes are without any further optimizations (will come gradually).
## Different bundles
This is what is exported:
```
dist
├── instantsearch.development.js
├── instantsearch.development.js.map
├── instantsearch.production.min.js
└── instantsearch.production.min.js.map
cjs
├── components
├── connectors
├── helpers
├── index.js
├── lib
├── src
└── widgets
es
├── components
├── connectors
├── helpers
├── index.js
├── lib
└── widgets
```
### UMD
The files have been renamed to become clearer for the users.
#### Usage
```html
<script src="instantsearch.production.min.js"></script>
```
### CJS
#### Usage
```js
const instantsearch = require('instantsearch.js').default
```
### ES
No changes.
## Development and production bundles
Since the bundle is getting heavy, the migration to Rollup has made it easier to create separate UMD bundles:
- `instantsearch.development.js`
- `instantsearch.production.min.js`
These names were inspired by the [React strategy](https://unpkg.com/[email protected]/umd/).
The development bundle will include everything that the default bundle has so far. The production bundle will not include the warnings (everything that is runtime) and the verbose widget/connector usages.
Everything under this condition will get stripped in the production bundle:
```js
if (__DEV__) {
// development only
}
```
In the CJS and ES bundle, it's converted to:
```js
if (process.env.NODE_ENV === 'development') {
// development only
}
```
## What's next
This new bundle strategy allows to gradually remove development feature from the production bundle.
This makes the render and unmount lifecycle functions optional for the `configure` widget. It's more straightforward to use `connectConfigure`.
<a name=3.0.0-beta.1></a> # [3.0.0-beta.1](v2.10.3...v3.0.0-beta.1) (2018-12-14) ### Bug Fixes * **api:** remove transformData ([#3241](#3241)) ([5232936](5232936)) * **breadcrumb:** fix story with transformed label ([5a39312](5a39312)) * **breadcrumb:** rename item's name to label ([#3273](#3273)) ([0189cb4](0189cb4)) * **breadcrumb:** rename noRefinement to noRefinementRoot ([#3272](#3272)) ([21a5c61](21a5c61)) * **community:** fix search config ([#3142](#3142)) ([2b41982](2b41982)) * **configure:** make lifecycle functions optional ([#3339](#3339)) ([2b88cfa](2b88cfa)) * **connectRangeSlider:** remove deprecated connector ([#3189](#3189)) ([096ebeb](096ebeb)) * **current-refinements:** remove alphabetic sorting ([#3249](#3249)) ([9914f87](9914f87)), closes [/github.com/algolia/instantsearch.js/blob/011d47909894837f2c2da5088bc81803135d201b/src/lib/utils.js#L249](https://github.com//github.com/algolia/instantsearch.js/blob/011d47909894837f2c2da5088bc81803135d201b/src/lib/utils.js/issues/L249) * **getRefinements:** provide attributeName for type: query ([6006fe1](6006fe1)), closes [#3205](#3205) * **highlight:** avoid to ignore highlightedTagName ([#3323](#3323)) ([9871829](9871829)) * **highlight:** HighLight -> Highlight ([#3324](#3324)) ([5b4600d](5b4600d)) * **hits:** transform items after escaping ([#3251](#3251)) ([c46b82a](c46b82a)), closes [#3250](#3250) * **infiniteHits:** move option to templates ([#3300](#3300)) ([1828d66](1828d66)) * **InfiniteHits:** set the correct class for the last page ([#3232](#3232)) ([f604835](f604835)) * **lint:** remove unused import ([a9ec14c](a9ec14c)) * **pagination:** rename to ([#3275](#3275)) ([336945b](336945b)) * **poweredBy:** export connectPoweredBy connector ([#3331](#3331)) ([7d48c46](7d48c46)) * **poweredBy:** fix CSS classes ([#3332](#3332)) ([abc9b82](abc9b82)) * **range-input:** fix button classname ([#3234](#3234)) ([56695e1](56695e1)), closes [algolia/instantsearch-specs#92](algolia/instantsearch-specs#92) * **range-input:** remove templates ([#3128](#3128)) ([94a1ce5](94a1ce5)) * **rangeInput:** convert labels to templates ([#3312](#3312)) ([cdf91e8](cdf91e8)) * **rangeSlider:** fix CSS classes ([#3316](#3316)) ([56a5255](56a5255)) * **refinement-list:** remove in story ([0bf8db1](0bf8db1)) * **routing:** enforce RoutingManager is the last widget ([#3149](#3149)) ([1e86b2e](1e86b2e)), closes [#3148](#3148) * **searchbox:** fix and templates ([#3313](#3313)) ([4e13122](4e13122)) * **tests:** add react-test-renderer ([176494b](176494b)) * **toggleRefinement:** provide to templates ([#3303](#3303)) ([f515b62](f515b62)) ### Features * **3.0:** remove named exports on widgets ([#3129](#3129)) ([e718ea3](e718ea3)) * **breadcrumb:** implement InstantSearch.css ([#3115](#3115)) ([84d9f18](84d9f18)) * **bundle:** update bundle strategy ([#3260](#3260)) ([a7dab81](a7dab81)) * **clearRefinements:** implement InstantSearch.css ([#3308](#3308)) ([d98ecaf](d98ecaf)), closes [#3299](#3299) * **clearRefinements:** implement is.css ([#3114](#3114)) ([11cdc14](11cdc14)) * **current-refinements:** implement InstantSearch.css ([#3190](#3190)) ([a70917d](a70917d)) * **GeoSearch:** implement InstantSearch.css ([#3138](#3138)) ([1867d30](1867d30)) * **hierarchical-menu:** implement InstantSearch.css ([#3182](#3182)) ([be0890d](be0890d)) * **hierarchical-menu:** implement show more feature ([#3151](#3151)) ([f54fccd](f54fccd)) * **hierarchicalMenu:** merge showMore templates ([#3318](#3318)) ([0059251](0059251)) * **highlight:** export highlight function ([#3137](#3137)) ([d4b6fb1](d4b6fb1)) * **highlight:** implement InstantSearch.css ([#3132](#3132)) ([260a0b8](260a0b8)) * **hits:** implement InstantSearch.css ([#3096](#3096)) ([b3cc413](b3cc413)) * **hits-per-page:** implement InstantSearch.css ([#3125](#3125)) ([49e7096](49e7096)) * **infiniteHits:** rename showMore template to showMoreText ([#3330](#3330)) ([babad39](babad39)) * **menu:** implement InstantSearch.css ([#3181](#3181)) ([a274ab7](a274ab7)) * **menu:** merge showMore templates ([#3328](#3328)) ([73a450b](73a450b)) * **menuSelect:** implement is.css ([#3109](#3109)) ([43e654a](43e654a)) * **numeric-menu:** implement InstantSearch.css ([#3162](#3162)) ([f5358f4](f5358f4)) * **numericSelector:** remove widget ([#3183](#3183)) ([e9063c0](e9063c0)) * **pagination:** implement InstantSearch.css ([#3119](#3119)) ([f3c3343](f3c3343)) * **pagination:** rename labels to templates ([#3333](#3333)) ([9f24098](9f24098)) * **panel:** add Panel widget ([#3253](#3253)) ([82e19fc](82e19fc)) * **poweredBy:** disable setting URL from widget ([#3334](#3334)) ([a5ff6af](a5ff6af)) * **poweredBy:** implement InstantSearch.css ([#3164](#3164)) ([bcc18a0](bcc18a0)) * **poweredBy:** update logo ([#3256](#3256)) ([838abec](838abec)) * **price-ranges:** implement InstantSearch.css ([#3124](#3124)) ([335339b](335339b)) * **range-input:** implement InstantSearch.css ([#3098](#3098)) ([ee6bc7e](ee6bc7e)) * **range-slider:** implement InstantSearch.css ([#3126](#3126)) ([b9b8d31](b9b8d31)) * **rating-menu:** implement InstantSearch.css ([#3161](#3161)) ([d039e11](d039e11)) * **ratingMenu:** merge labels and templates ([#3317](#3317)) ([505a2e7](505a2e7)) * **refinement-list:** implement InstantSearch.css ([#3152](#3152)) ([11c5580](11c5580)) * **refinement-list:** implement InstantSearch.css (2) ([#3179](#3179)) ([0365641](0365641)) * **refinement-list:** implement InstantSearch.css to searchbox ([#3263](#3263)) ([ad905c7](ad905c7)) * **refinementList:** merge showMore templates ([#3329](#3329)) ([9b6a9c4](9b6a9c4)) * **search-client:** use search client ([#3133](#3133)) ([8e70a3e](8e70a3e)) * **searchbox:** implement InstantSearch.css ([#3127](#3127)) ([c68c1fe](c68c1fe)) * **snippet:** implement InstantSearch.css ([#3134](#3134)) ([fa56657](fa56657)) * **sort-by:** implement InstantSearch.css ([#3120](#3120)) ([5f21723](5f21723)) * **sortBy:** rename item to ([#3230](#3230)) ([9e24a68](9e24a68)) * **stats:** implement InstantSearch.css ([#3097](#3097)) ([63a688e](63a688e)) * **stories:** add default CurrentRefinements story ([#3252](#3252)) ([45a8fd5](45a8fd5)) * **suit:** Default component names to empty object ([0b26356](0b26356)) * **suit-helper:** provide a helper to create suit css classnames ([f142496](f142496)) * **toggleRefinement:** implement InstantSearch.css ([#3135](#3135)) ([d67a437](d67a437)) * **widgets:** use warn utils ([#3175](#3175)) ([3164b06](3164b06)) * compress templates ([#3176](#3176)) ([54f2f77](54f2f77)), closes [#3095](#3095)
* test(core): can call start without widgets * chore(core): remove uncalled error * chore(core): remove lodash usage will work because this.widgets is always an array (never undefined, nor an object)
The separator used in the records was never overridable from the widget. This passes the `separator` value to the connector.
- Rename `escapeHits` to `escapeHTML` - Default `escapeHTML` to true
This makes `connectHits` `escapeHTML` default to `true` at the connector level rather than at the widget level. It escapes by default the custom hits user implementations.
* fix(connectInfiniteHits): default escapeHTML to true * test(connectInfiniteHits): test default config
Using the beta version for now.
This uses the latest beta version for now (https://cdn.jsdelivr.net/npm/instantsearch.js@beta).
Implements #3343 fixes for `menu`.
An example of a previously failing widget using `panel` is `ratingMenu`. Closes #3347.
Implements #3343 fixes for `refinementList`.
Update the highlighting syntax and remove `document.querySelector()`s.
* feat(menuSelect): rename seeAllOptions template to defaultOption * fix(stories): update story name Co-Authored-By: francoischalifour <[email protected]>
This removes a remaining test depending on `autoHideContainer`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request opened from visibility.