-
Notifications
You must be signed in to change notification settings - Fork 530
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(clearRefinements): implement is.css #3017
Conversation
Deploy preview for algolia-instantsearch ready! Built with commit 4f7599f https://deploy-preview-3017--algolia-instantsearch.netlify.com |
dev/app/builtin/init-stories.js
Outdated
@@ -1,6 +1,6 @@ | |||
import initAnalyticsStories from './stories/analytics.stories'; | |||
import initBreadcrumbStories from './stories/breadcrumb.stories.js'; | |||
import initClearAllStories from './stories/clear-all.stories'; | |||
import initClearRefinementsStories from './stories/clear-refinements.stories.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the extension we should statute with or without and maybe add an ESLint rule for it. WDYT?
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes agreed. By default, VScode will not add it but that's not the behavior everywhere. Most of the code in is.js has .js
extensions, but with a rule it can be --fix
ed easily. No opinions on the topic, happy to do the changes :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well --fix
doesn't work for the rule: import/extensions
. This makes this change very painful. Also the codebase is mostly using extension except for packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we can enforce the extensions only for InstantSearch but at least statute on something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we can enforce the extensions only for InstantSearch but at least statute on something.
Ok. If I were to make a choice here, I'd go for no extensions:
- it's easier to setup the rules in eslint
- we are inconsistent when it comes to packages (no extensions even for files in packages)
- vsCode (the editor that we use as far I understand) doesn't add extensions by default
It's a big change but I guess it could be done with a mass replace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev/template.html
Outdated
@@ -5,6 +5,7 @@ | |||
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |||
<title>Instant search demo built with instantsearch.js</title> | |||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,Array.from"></script> | |||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@7.0.0/themes/reset-min.css"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The theme algolia
already contains the reset
. We don't need to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good to know 👍
@@ -13,7 +13,7 @@ const __DEV__ = process.env.NODE_ENV === 'development'; | |||
const clean = arr => arr.filter(item => item !== false); | |||
|
|||
module.exports = { | |||
devtool: __DEV__ ? 'cheap-module-source-map' : 'source-map', | |||
devtool: 'source-map', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't slow down too much the build time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I heavily use the debugger and cheap-module-source-map
is not good. It slows down the build but not too much to my taste :) I guess it's a matter of usage here. Happy to revert if it's a blocker :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a blocker @samouss ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely not!
|
||
| In V2 | In V3 | | ||
| --------------- | ----------------------- | | ||
| connectClearAll | connectClearRefinements | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be in the section above "Renamed connectors" rather than "Renamed parameters".
|
||
* `excludeAttributes` → `excludedAttributes` | ||
|
||
Values for `classNames` have been updated to reflect the markup changes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter is called cssClasses
not classNames
right?
@@ -0,0 +1,68 @@ | |||
import React from 'react'; | |||
import sinon from 'sinon'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we take advantage of this refactor to drop sinon
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 👍
@@ -0,0 +1,125 @@ | |||
import React, { render, unmountComponentAtNode } from 'preact-compat'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should align the casing of the files with the rewrite. Components are pascal case, connectors camel case and the widget "kebab" case. IMO it's okay to have the components with a different case for the file but we should at least align the connectors & widgets. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we said that the file / folders should have the same case as the exported symbol. So it's gonna be camelCase then for widgets. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There is also an "issue" with /components/ClearRefinements/ClearRefinements.js
, in that case ClearRefinements
is a bit redundant. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. On one hand, it's nicer, but on the other it brings little value and the test are more easy to find with a nested structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that in another PR if we decide to move forward. Ok @samouss ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
@@ -0,0 +1,125 @@ | |||
import React, { render, unmountComponentAtNode } from 'preact-compat'; | |||
import ClearRefinementsWithHOCs from '../../components/ClearRefinements/ClearRefinements.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can rename it, we don't have any HOC anymore.
We don't have anymore dependencies here. |
Thanks @samouss for taking the time to review :) |
Summary
This PR implements is.css for the widget clear-all, which is now renamed to clear-refinements.
This also removes the panel from the widget.
Result
https://deploy-preview-3017--algolia-instantsearch.netlify.com/v2/dev-novel/?selectedStory=ClearRefinements.default