Commit 1d4c472
authored
33073 rxjs from v6 to v7 (#35145)
This pull request focuses on migrating the codebase away from deprecated
RxJS 6 patterns to be fully compatible with RxJS 7.8.2. The changes are
primarily aimed at replacing deprecated operators like `pluck`,
`switchMapTo`, and `publishLast` with their recommended alternatives, as
well as updating test code to align with newer RxJS error handling APIs.
The refactor touches a wide range of files, particularly in the
`dotcms-ui` app, and ensures improved maintainability and future
compatibility.
**RxJS Operator Refactoring:**
* Replaced deprecated `pluck` operator with `map` across all usages in
the codebase, updating selector logic accordingly
[[1]](diffhunk://#diff-6c19b151b96d1e9277930b34178414a4bb8edb3727bf54efb078f67722d91679L6-R6)
[[2]](diffhunk://#diff-6c19b151b96d1e9277930b34178414a4bb8edb3727bf54efb078f67722d91679L42-R47)
[[3]](diffhunk://#diff-a38219f03b97c41ff2b3e3e6fda3171d8deed438c9c1d5f933c30d3dd58fbb32L21-R21)
[[4]](diffhunk://#diff-a38219f03b97c41ff2b3e3e6fda3171d8deed438c9c1d5f933c30d3dd58fbb32L84-R89)
[[5]](diffhunk://#diff-033a32c658da882cbc2420b75ca50850898c3f1e6c722bb2add6522da75c6349L8-R8)
[[6]](diffhunk://#diff-033a32c658da882cbc2420b75ca50850898c3f1e6c722bb2add6522da75c6349L82-R85)
[[7]](diffhunk://#diff-188a97cb6de981d161e466dfc422052b39ac67ec5c4753ef54db7065442ef430L6-R6)
[[8]](diffhunk://#diff-188a97cb6de981d161e466dfc422052b39ac67ec5c4753ef54db7065442ef430L41-R44)
[[9]](diffhunk://#diff-ab22dfefdad25b6f40208fe418538738c29327375fbb37072ba18d098effa330L8-R8)
[[10]](diffhunk://#diff-ab22dfefdad25b6f40208fe418538738c29327375fbb37072ba18d098effa330L64-R64)
[[11]](diffhunk://#diff-f737fd3bdbe5670f34ce3ee6a82c427a5460835c6222b86527b9f3aa6e17a044L7-R7)
[[12]](diffhunk://#diff-f737fd3bdbe5670f34ce3ee6a82c427a5460835c6222b86527b9f3aa6e17a044L25-R25).
* Replaced deprecated `switchMapTo` with `switchMap` in all affected
streams, updating function signatures where necessary
[[1]](diffhunk://#diff-b202dfd3e850f6f8d29a81e0f698f305309a1d524fcb089138c0eed4f0b0e2d0L9-R9)
[[2]](diffhunk://#diff-b202dfd3e850f6f8d29a81e0f698f305309a1d524fcb089138c0eed4f0b0e2d0L170-R170)
[[3]](diffhunk://#diff-b202dfd3e850f6f8d29a81e0f698f305309a1d524fcb089138c0eed4f0b0e2d0L191-R191).
* Replaced deprecated `publishLast`/`refCount` combo with `shareReplay`
for caching HTTP responses
[[1]](diffhunk://#diff-6d1086b6ba6f8165deecbdc80ac9408a311b0b72781c89d3979b225a226f046aL6-R6)
[[2]](diffhunk://#diff-6d1086b6ba6f8165deecbdc80ac9408a311b0b72781c89d3979b225a226f046aL72-R66).
* Updated usages of `pluck` in service methods to `map`, ensuring type
safety and clarity.
**Test and Error Handling Updates:**
* Updated all usages of `throwError(error)` to the RxJS 7+ pattern
`throwError(() => error)` in tests and services for proper error
emission
[[1]](diffhunk://#diff-cb2b54d67fe7a39ef735fb2a985b7202ba8e25b653e456eeed74ada2bfc1ddbaL107-R107)
[[2]](diffhunk://#diff-c0762a9384069a32c029261a27d2ab7ae8bce5eea7850d8188a93f0cd8502341L158-R158)
[[3]](diffhunk://#diff-c0762a9384069a32c029261a27d2ab7ae8bce5eea7850d8188a93f0cd8502341L181-R183)
[[4]](diffhunk://#diff-c0762a9384069a32c029261a27d2ab7ae8bce5eea7850d8188a93f0cd8502341L202-R204)
[[5]](diffhunk://#diff-56b35eae311934a1279fbbf6999050daa4da884729bc6cac65890f20b2e61602L320-R320).
**Testing Utilities Modernization:**
* Replaced deprecated `fakeAsync`/`tick` usage with Jest timer mocks
(`jest.useFakeTimers`, `jest.advanceTimersByTime`, `jest.useRealTimers`)
in component tests for more robust async testing
[[1]](diffhunk://#diff-3bdd1a7f98eb62dd492e069085d19306cc031c98605e1e67f6f9e017494d9ba3L5-L6)
[[2]](diffhunk://#diff-3bdd1a7f98eb62dd492e069085d19306cc031c98605e1e67f6f9e017494d9ba3R62)
[[3]](diffhunk://#diff-3bdd1a7f98eb62dd492e069085d19306cc031c98605e1e67f6f9e017494d9ba3R85)
[[4]](diffhunk://#diff-3bdd1a7f98eb62dd492e069085d19306cc031c98605e1e67f6f9e017494d9ba3L107-R112).
**Documentation:**
* Added `.cursor/plans/rxjs_7_migration_plan_c65e7afc.plan.md` to
document the migration plan and provide an overview of the categories
and scope of changes.
This PR fixes: #330731 parent b085255 commit 1d4c472
128 files changed
Lines changed: 828 additions & 692 deletions
File tree
- core-web
- apps
- dotcdn/src/app
- dotcms-ui/src
- app
- api/services
- portlets
- dot-apps
- components
- dot-apps-configuration-detail
- dot-apps-configuration
- dot-apps-import-export-dialog/store
- dot-containers
- container-list/store
- dot-container-create
- dot-container-properties/store
- dot-form-builder
- dot-pages
- dot-create-page-dialog
- dot-pages-store
- services
- store
- withFavorite
- dot-templates/dot-template-create-edit
- dot-template-props/dot-template-thumbnail-field
- store
- view/components
- _common
- dot-workflows-actions-selector-field/services
- iframe/iframe-porlet-legacy
- dot-add-persona-dialog
- dot-contentlet-editor/components/dot-create-contentlet
- dot-device-selector
- dot-toolbar/components/dot-my-account
- login
- dot-login-component
- forgot-password-component
- main
- reset-password-component
- stories/primeng/overlay
- libs
- block-editor/src/lib
- extensions/asset-form/components/dot-upload-asset
- data-access/src/lib
- dot-ai
- dot-analytics-search
- dot-content-search
- dot-content-type
- dot-contentlet
- dot-copy-content
- dot-edit-page-resolver
- dot-experiments
- dot-field
- dot-license
- dot-messages
- dot-page-state
- dot-page-tools
- dot-page-workflows-actions
- dot-properties
- dot-resource-links
- dot-site
- dot-upload-file
- dot-versionable
- dot-workflow-actions-fire
- dot-workflows-actions
- dot-workflow
- ema-app-configuration
- dot-rules/src/lib/services/api/rule
- dotcms-js/src/lib/core/util
- edit-content-bridge
- edit-content/src/lib
- fields
- dot-edit-content-category-field/services
- dot-edit-content-file-field
- components
- dot-file-field-preview
- dot-form-import-url/store
- store
- dot-edit-content-relationship-field/components/dot-select-existing-content
- components/search/components
- language-field
- site-field
- store
- services
- store/features
- activities
- content
- history
- lock
- user
- workflow
- portlets
- dot-analytics/portlet/src/lib/dot-analytics-search/store
- dot-content-drive/portlet/src/lib
- components
- dialogs/dot-content-drive-dialog-folder
- dot-content-drive-toolbar/components
- dot-content-drive-content-type-field
- dot-content-drive-workflow-actions
- dot-content-drive-shell
- store
- dot-experiments/portlet/src/lib
- dot-experiments-configuration/store
- dot-experiments-list/store
- dot-locales/portlet/src/lib/dot-locales-list/store
- dot-tags/src/lib
- dot-tags-import
- dot-tags-list/store
- dot-usage/src/lib/dot-usage-shell
- edit-ema
- portlet/src/lib
- components
- dot-block-editor-sidebar
- dot-ema-dialog
- edit-ema-editor
- components
- dot-uve-palette/components
- dot-uve-palette-list/store
- dot-uve-style-editor-form
- dot-uve-toolbar
- services
- dot-action-url
- store/features/editor
- save
- ui/src/lib
- dot-content-compare/components/dot-content-compare-dialog
- dot-favorite-page
- store
- template-builder/src/lib/components/template-builder
- store
- ui/src/lib
- components
- dot-ai-image-prompt/store
- dot-asset-search/store
- dot-browser-selector/store
- dot-content-type
- dot-form-dialog
- dot-language-selector
- dot-site
- services/dot-browsing
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
Lines changed: 6 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 6 | + | |
16 | 7 | | |
17 | 8 | | |
18 | 9 | | |
| |||
33 | 24 | | |
34 | 25 | | |
35 | 26 | | |
36 | | - | |
| 27 | + | |
37 | 28 | | |
38 | 29 | | |
39 | 30 | | |
| |||
69 | 60 | | |
70 | 61 | | |
71 | 62 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
75 | 67 | | |
76 | 68 | | |
77 | 69 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| |||
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
Lines changed: 21 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
0 commit comments