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

Upgrade preact-i18n to 2.3.1-preactx #1133

Merged
merged 2 commits into from
Apr 19, 2021

Conversation

rob-mccann
Copy link
Contributor

@rob-mccann rob-mccann commented Apr 8, 2021

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • Did you add fake requests data for the demo mode (front/src/config/demo.json) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

preact-i18n uses the new Context API and has removed support for the legacy API.

I've added a sort of shim in for now into these functions to allow us to rewrite them to use the new API one by one.

Allows #1128 to be re-added.

Closes #1132

@rob-mccann rob-mccann force-pushed the intl branch 2 times, most recently from 7c8d676 to 682d13a Compare April 8, 2021 21:54
@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #1133 (1eb3079) into master (1d58b39) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1133   +/-   ##
=======================================
  Coverage   96.27%   96.27%           
=======================================
  Files         639      639           
  Lines        8097     8097           
=======================================
  Hits         7795     7795           
  Misses        302      302           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d58b39...1eb3079. Read the comment docs.

Copy link
Contributor

@atrovato atrovato left a comment

Choose a reason for hiding this comment

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

That's a good point!!!
All 'context' usages look changed.
I need to test it locally new.

front/src/utils/withIntlAsProp.js Outdated Show resolved Hide resolved
atrovato
atrovato previously approved these changes Apr 9, 2021
Copy link
Contributor

@atrovato atrovato left a comment

Choose a reason for hiding this comment

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

Works fine locally.

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles 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! I tested on most screens. Couldn't test some integrations (Zigbee2mqtt), l'll merge this on master, build a docker dev tag and ask the community to make sure everything is working properly.

Thank you for your contribution! 👏

@Pierre-Gilles Pierre-Gilles merged commit fd938df into GladysAssistant:master Apr 19, 2021
@rob-mccann rob-mccann deleted the intl branch April 19, 2021 08:42
Jean-PhilippeD pushed a commit to Jean-PhilippeD/Gladys that referenced this pull request Oct 13, 2021
Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>
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.

Upgrade preact-i18n
3 participants