FS-23: Browser console errors from package updates #55
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.
Ticket
FS-23: Browser console errors from package updates
Description
componentWillReceiveProps
componentDidUpdate
for following components:FederatedRangeFacet
(when the date range facet is cleared)FederatedTextSearchNoAutocomplete
(applies when autocomplete is enabled in.env.local.js
)And used prefixed
UNSAFE_
for:FederatedTextSearchAsYouType
component in federated search, I prefixed the lifecycle with aUNSAFE_
, as updating the lifecycle tocomponentDidUpdate
caused a fatal nesting error on render. We might need to open a new ticket to address this independently, there could additional work around this upgrade. There is a roadmap that will eventually drop support/usages ofcomponentWillReceiveProps
in React 17. I will need to dig into this separately as there could be additional work for updatingFederatedTextSearchAsYouType
(without appendingUNSAFE_
)There are warnings coming from
react-dates
andreact-autosuggest
. These warning relates to Reacts update/new approach to implementing lifecycles. Seems likecomponentWillReceiveProps
is being deprecated. The easiest way to suppress the warning is to prefix the lifecycle with aUNSAFE_
.The packages that have not upgraded their code to React 16 stated it will be a breaking change for the package. These are:
react-dates
for the Start/End fields, theDateInput
component has thecomponentWillReceiveProps
deprecated code.react-autosuggest
for autosuggestion in the text box usescomponentWillReceiveProps
.Additionally, when enabling autocomplete, I got a breaking
checker function
error in the console. I addedPropTypes.shape{()}
to theresults
andterm
properties forFederatedTextSearchAsYouType
component.For the packages using
componentWillReceiveProps
, we could roll a patch to addUNSAFE_
prefixes? Let me know if that makes sense as a temporary stop gap.Testing
nodes_modules
env.local.js
hasautocomplete
uncommentedyarn && yarn start
Ensure you only see warnings fromDateInput
andAutosuggest
packages (more in Description, above) about this warning.Observe for any other warning, asides fromDateInput
andAutosuggest
packages.