Update dependency ember-intl to v7 #2572
Open
+2,253
−1,297
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.
This PR contains the following updates:
4.4.1
->7.0.9
Release Notes
ember-intl/ember-intl (ember-intl)
v7.0.9
: Re-released v7.0.8 (removes the accidentally published files from a development branch)Compare Source
See https://github.com/ember-intl/ember-intl/releases/tag/v7.0.8 for release notes.
v7.0.8
: Removed the usages of Ember Helper's recompute and eventemitter3 as a dependency. Updated dependencies.Compare Source
Internal changes:
intl
's service's private methodonLocaleChanged()
has been removed.ember-intl
is now tested againstember-lts-5.12
(instead ofember-lts-5.4
andember-lts-5.8
).v7.0.7
: Updated dependencies and documentationsCompare Source
Thanks to @MichalBryxi, @balinterdi, and @amk221 for their help with improving the docs.
v7.0.6
: Listed @ember/test-helpers as a peer dependency. Made pnpm settings stricter.Compare Source
Thanks to @wozny1989 for reporting the issue, and @NullVoxPopuli for helping me fix the failing
ember-try
scenarios.v7.0.5
: Updated dependencies. Used pnpm@9 to manage dependencies.Compare Source
v7.0.4
: Silenced logs during build by defaultCompare Source
Due to an incorrect code cleanup in
v5
orv6
,ember-intl
had always logged messages (e.g. ICU argument mismatch, missing translation).For the time being,
ember-intl@v7
will not log these messages by default. If you need these logs, you may setverbose: true
(consider this a private API) inconfig/ember-intl.js
until the addon provides a better solution:/* config/ember-intl.js (remaining keys omitted for brevity) */ module.exports = function (/* environment */) { return { + verbose: true, }; };
Thanks to @Techn1x for the bug fix.
v7.0.3
: Refactored intl serviceCompare Source
What changed?
inputPath
correctly for v1 addons~ (doesn't work yet;tests/dummy/config/ember-intl.js
should showinputPath: 'tests/dummy/translations'
)exists()
and types in theintl
serviceember-lts-5.8
toember-try
scenariosv7.0.2
: Made getTranslation() public and fixed a bug in setOnFormatjsError()Compare Source
The
intl
service'sgetTranslation()
is now a public method, so that you may keep extracting a translation message's arguments as you might have done withlookup()
inv6
. I went with a patch release (instead of a minor), since changinglookup()
to be a private method inv7.0.0-beta.6
could be considered a regression.The documentations for
{{t}}
helper andintl
service have been updated so that end-developers may know what to do when a translation has arguments with missing values.v7.0.1
: Reintroduced extend to handle deeply nested translation foldersCompare Source
7.0.1
patches a regression introduced in7.0.0-beta.4
(affects Ember apps that setwrapTranslationsWithNamespace: true
; see #1895).Thanks to @pulien for discovering the issue and providing a reproduction project.
v7.0.0
: Beginning of the 7.x seriesCompare Source
Highlights
intl
service to provide native types (improved TS and Glint support)ember-intl
Migration guide
To do an incremental update from
6.5.5
, you may install these versions in sequence:7.0.0-beta.2
7.0.0-beta.5
7.0.0-beta.6
7.0.0
To learn breaking changes, please check https://ember-intl.github.io/ember-intl/docs/migration/v7 and the release notes for each beta version.
v6.5.6
: Listed @ember/test-helpers as a peer dependency. Made pnpm settings stricter.Compare Source
Thanks to @wozny1989 for reporting the issue, and @NullVoxPopuli for helping me fix the failing
ember-try
scenarios.v6.5.5
: Added @babel/core as a dependency (required by ember-cli-babel@v8)Compare Source
Thanks to @mkszepp. (The patch can also be found in
v7.0.0-beta.5
.)v6.5.4
: Removed broccoli-merge-files (security patch)Compare Source
Thanks to @LucasHill for removing the dependency. (The patch can also be found in
v7.0.0-beta.3
.)v6.5.3
: Fixed a memory leak introduced in v6.3.0. Ensured that registerDestructor is called when helpers are destroyed.Compare Source
Thanks to @johanrd for investigating the issue and providing the fix quickly.
v6.5.2
: Updated ember-cli-typescript to v5.3.0. Deprecatedember g translation
.Compare Source
Updating
ember-cli-typescript
will help remove warnings thatember-intl
(along with other addons) might have produced.WARNING: ember-cli-typescript requires ember-cli-babel ^7.17.0, but you have version 8.0.0 installed; your TypeScript files may not be transpiled correctly
v6.5.1
: Documented how to provide translations in apps, v1 addons, and v2 addonsCompare Source
In the
docs
folder, I created 3 additional projects so that there's a living documentation (tested in CI) of how apps, v1 addons, and v2 addons can provide translations.I also updated the documentation site. You will find new content in:
Getting Started > Overview
Getting Started > Quickstart (Apps)
Getting Started > Quickstart (Addons)
v6.5.0
: Refactored intl service and private utilitiesCompare Source
Thanks to @bertdeblock for fixing a URL typo in the blueprints.
v6.4.1
: Updated dependencies. Added ember-lts-5.4 to ember-try scenarios.Compare Source
The dependencies of
ember-intl
(in particular,@types/ember__runloop
and@types/ember__template
) have been updated to the latest version. This may fix the error messages shown below:Thanks to @jelhan.
v6.4.0
: Improved DX and deprecated macrosCompare Source
What changed?
setLocale()
andaddTranslation()
to callsettled()
v7.0.0
)<template>
-tag support (allowed importing helpers fromindex
)Migration guide
Test helpers
Before
v6.4.0
, callingsetLocale()
andaddTranslations()
wouldn't have an effect on the application in tests. You might have had to callawait settled()
or use something from@ember/runloop
to trigger an update.Now, the test helpers handle the update and mean the following in tests:
setLocale()
- update the locale as if the user had somehow changed their preferred languageaddTranslations()
- update the translations as if you had somehow added them (e.g. via lazy loading)You will want to search your test files for
setLocale(
,addTranslations(
, andember-intl/test-support
, then migrate code as follows:Example:
setLocale()
Example:
addTranslations()
Macros
In classic and Glimmer components, inject the
intl
service to access its methods. If you want to create a value that depends on other things, you can use the@computed
decorator (i.e. create a computed property) in classic and the native getter in Glimmer components. Alternatively, you can useember-intl
's helpers in the template.Before: A classic component with macros
After: A Glimmer component with getters
Helpers in
<template>
-tag componentsBefore
v6.4.0
, you had to remember and write the full path to use one ofember-intl
's helpers in a<template>
-tag component. Now, you can import all helpers from theindex
file.Example:
t()
v6.3.2
: Fixed two regressions introduced in v6.3.0Compare Source
What changed?
Reverted the removal of the class property
allowEmpty
If you happened to overwrite an
ember-intl
's helper so that, in your app, the helper allows "empty" values by default, then you may continue to use the following syntax:However, this (overwriting the addon, especially through inheritance) is not recommended, as implementation details can change in the future.
Allowed the intl service to handle removing event listeners
In addition to separating concerns better, the pull request fixes an error that you might have seen in your tests after installing
[email protected]
or6.3.1
.v6.3.1
: Updated helper signatures. Rewrote tests for helpers.Compare Source
I fixed the type issues introduced in
6.3.0
. All helpers have a return type ofstring
once again.v6.3.0
: Remove inheritance among helpersCompare Source
I removed the base helper
-format-base.js
so that the code for each helper is easier to understand and maintain.Example of a migration
Compared to
v6.2.2
, the unpacked size may be slightly larger (~2 kB). On the plus side, a few type errors and hidden bugs (runtime errors) should be fixed now. Since the code change is large, I went with a minor release to be on the safe side.v6.2.2
: Fixed a type regressionCompare Source
If you encountered TypeScript errors of the following form after installing
6.2.0
or6.2.1
,please try installing
6.2.2
instead. As a temporary fix, I cast the return type of the test helpert()
to bestring
.v6.2.1
: Enabled embroider-safe and embroider-optimized scenarios. Updated dependencies.Compare Source
In CI (continuous integration), we can now show that
ember-intl
(still a v1 addon) passesembroider-safe
andembroider-optimized
scenarios.To ease maintenance, I removed 3 dependencies (
lodash.omit
,has-unicode
, andlocale-emoji
) that affect the private implementation. The removal shouldn't affect the public API, so I believe we can do with a patch release.v6.2.0
: Introduced workspaces. Updated @glint/* to v1.2.1.Compare Source
I changed the project structure to resemble that of a v2 addon. Workspaces should also help us understand the dependencies of each package and the origin of an error. The latter is demonstrated by the ability to update
@glint/*
packages from0.9.7
to the latest.v6.1.2
: Updated dependencies and addressed vulnerabilitiesCompare Source
Sample patch file for
[email protected]
v6.1.1
: Failed attempt to address a vulnerabilityCompare Source
v6.1.0
: Beginning of the 6.x seriesAlmost 2 years passed since
5.7.2
had been released. Many thanks to those who have continued to useember-intl
and even tried out6.0.0-beta.x
.If you run into a breaking change that hasn't been documented, please let us know by opening an issue and/or creating a pull request.
https://ember-intl.github.io/ember-intl/docs/guide/migration-5-0-to-6-1
v6.0.0
Compare Source
v5.7.2
Compare Source
v5.7.1
Compare Source
v5.7.0
Compare Source
36f22d4
9563ed4
ddf9760
v5.6.2
Compare Source
default
export forintl
service72d2194
v5.6.1
Compare Source
66aa983
defec78
151bf9a
7f01978
8c99934
ember-canary
(#1482)aa5c9c0
v5.6.0
Compare Source
ember-canary
6623c0d
4738925
36ff7c8
c75ff43
Fixes a potential import type parser error.
typescript@4
(#1442)912c901
-format-base
helper publicly (#1449)e4a4563
v5.5.1
Compare Source
ember-cli-babel
c2bddb8
Fixes a potential
import type
parser error.v5.5.0
: The One With TypeScript SupportCompare Source
getWithDefault
#1435lookup()
#1409v5.4.2
Compare Source
🗞 What’s Changed
v5.4.1
Compare Source
ee94dce
v5.4.0
Compare Source
v5.3.1
Compare Source
v5.3.0
Compare Source
v5.2.2
Compare Source
v5.2.1
Compare Source
v5.2.0
Compare Source
Notable Changes
v5.1.1
Compare Source
v5.1.0
Compare Source
v5.0.9
Compare Source
v5.0.8
Compare Source
v5.0.7
Compare Source
v5.0.6
Compare Source
v5.0.5
Compare Source
v5.0.4
Compare Source
v5.0.3
Compare Source
v5.0.2
Compare Source
v5.0.1
Compare Source
v5.0.0
Compare Source
Notable Changes
Intl.PluralRules
APIIntl.MessageFormat
parser and compiler updated which changes how text and tags are escapedBreaking Changes
Intl.RelativeTime
polyfill has been replaced with the native API which behaves entirely different than the previous older spec implementation. Read more in the Migration DocumentshortNumber
formatting in favor of newly added native implementation using the"notation": "compact"
parameter forIntl.NumberFormat
i.e.,Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.