This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[terra-application-docs] Add upgrade-guide for terra-application v2 (#…
…388)
- Loading branch information
Showing
13 changed files
with
256 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
116 changes: 116 additions & 0 deletions
116
packages/terra-application-docs/src/terra-dev-site/app/UpgradeGuide.4.app.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Upgrade Guide | ||
|
||
## Upgrading from terra-application v1 to terra-application v2 | ||
|
||
### Unsupported functionality from V1 | ||
|
||
The following features are no longer supported with terra-application-v2 | ||
|
||
- **Custom locales**: | ||
Custom locales are no longer are supported due to react-intl v5 & webpack limitations. | ||
Terra currently supports the following locales: | ||
|
||
* en | ||
* en-AU | ||
* en-CA | ||
* en-US | ||
* en-GB | ||
* es | ||
* es-US | ||
* es-ES | ||
* de | ||
* fr | ||
* fr-FR | ||
* nl | ||
* nl-BE | ||
* pt | ||
* pt-BR | ||
* sv | ||
* sv-SE | ||
|
||
- **Custom terra-base implementation**: | ||
`terra-base` and `terra-i18n` are deprecated and not supported alongside terra-application v2. | ||
If these dependencies are installed, then they must be removed. | ||
If there are custom implementations utilizing these dependencies then they must be rewritten to utilize `terra-application/application-base`. | ||
|
||
### Prerequisites | ||
Upgrading to terra-application v2 has the following requirements: | ||
|
||
- Upgrading the project to Node 14. Terra-application v2 requires a minimum of Node 14, therefore the project must be up | ||
- Upgrading the project to Jest 29. If `jest-config-terra` is used, then it should be upgraded to v3. | ||
Refer to the upgrade guide for `jest-config-terra` on how to upgrade to v3. | ||
|
||
It is recommended to complete these prerequisites before upgrading to terra-application v2 to make the upgrade easier. | ||
|
||
### Code changes | ||
|
||
#### Dependency updates | ||
|
||
Once the prerequisites listed above are complete, the project can be upgraded to terra-application v2. | ||
terra-application v2 requires the following dependences versions to be updated as part of the upgrade process: | ||
* terra-aggregate-translations must be updated to v3. | ||
* webpack-config-terra must be updated to v4. | ||
* terra-dev-site must be updated to v8. | ||
* rect-intl must be updated to v5 as the above dependences and terra-application v2 all require v5 as a peerDependency. | ||
|
||
```diff | ||
"peerDependencies": { | ||
- "react-intl": "2", | ||
+ "react-intl": "5", | ||
- "terra-application": "1", | ||
+ "terra-application": "2", | ||
}, | ||
"devDependencies": { | ||
- "@cerner/terra-aggregate-translations": "2", | ||
- "@cerner/terra-dev-site": "7", | ||
- "@cerner/webpack-config-terra": "3", | ||
+ "@cerner/terra-aggregate-translations": "3", | ||
+ "@cerner/terra-dev-site": "8", | ||
+ "@cerner/webpack-config-terra": "4", | ||
} | ||
``` | ||
|
||
#### Import updates | ||
|
||
Terra-application now uses proper submodule export partterns. | ||
The table below maps the old imports to the new imports. | ||
|
||
| old imports | new imports | | ||
| ---------------------------------------------------------------------- | ------------------------------------------------------------------ | | ||
| `import ApplicationBase from 'terra-application'` | `import ApplicationBase from 'terra-application/application-base'` | | ||
| `import ApplicationBase from 'terra-application/lib/application-base'` | `import ApplicationBase from 'terra-application/application-base'` | | ||
| `import * from 'terra-application/lib/action-menu'` | `import * from 'terra-application/action-menu'` | | ||
| `import * from 'terra-application/lib/application-container'` | `import * from 'terra-application/application-container'` | | ||
| `import * from 'terra-application/lib/application-error-boundary'` | `import * from 'terra-application/application-error-boundary'` | | ||
| `import * from 'terra-application/lib/application-intl'` | `import * from 'terra-application/application-intl'` | | ||
| `import * from 'terra-application/lib/application-loading-overlay'` | `import * from 'terra-application/application-loading-overlay'` | | ||
| `import * from 'terra-application/lib/application-navigation'` | `import * from 'terra-application/application-navigation'` | | ||
| `import * from 'terra-application/lib/application-status-overlay'` | `import * from 'terra-application/application-status-overlay'` | | ||
| `import * from 'terra-application/lib/breakpoints'` | `import * from 'terra-application/breakpoints'` | | ||
| `import * from 'terra-application/lib/disclosure-manager'` | `import * from 'terra-application/disclosure-manager'` | | ||
| `import * from 'terra-application/lib/modal-manager'` | `import * from 'terra-application/modal-manager'` | | ||
| `import * from 'terra-application/lib/navigation-prompt'` | `import * from 'terra-application/navigation-prompt'` | | ||
| `import * from 'terra-application/lib/notification-banner'` | `import * from 'terra-application/notification-banner'` | | ||
| `import * from 'terra-application/lib/slide-panel-manager'` | `import * from 'terra-application/slide-panel-manager'` | | ||
| `import * from 'terra-application/lib/theme'` | `import * from 'terra-application/theme'` | | ||
| `import Logger from 'terra-application/lib/utils/logger'` | `import { Logger } from 'terra-application/utils'` | | ||
| `import EventEmitter from 'terra-application/lib/utils/event-emitter'` | `import { EventEmitter } from 'terra-application/utils'` | | ||
| `import * from 'terra-application/lib/workspace'` | `import * from 'terra-application/workspace'` | | ||
|
||
|
||
#### `react-intl` updates | ||
|
||
react-intl v5 no longer exports `intlShape`. All usage of `intlShape` would need to be updated as follows: | ||
|
||
```diff | ||
- intl: intlShape.isRequired, | ||
+ intl: PropTypes.shape({ formatMessage: PropTypes.func }).isRequired, | ||
``` | ||
|
||
For more information, refer to the react-intl upgrade guides. You may need to refer to the v3 & v4 upgrade guides in addition to v5. | ||
|
||
https://formatjs.io/docs/react-intl/upgrade-guide-5x | ||
|
||
https://formatjs.io/docs/react-intl/upgrade-guide-4x | ||
|
||
https://formatjs.io/docs/react-intl/upgrade-guide-3x |
4 changes: 4 additions & 0 deletions
4
...n-docs/src/terra-dev-site/tool/terra-dev-site/UpgradeGuides.f/v8.0.0.r.tool.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# v8 Upgrade Guide | ||
|
||
`terra-dev-site v8` requires `react-intl v5` and `terra-application v2` as peerDependencies. | ||
For more information, refer to the [terra-application v2 upgrade guide](../../app/upgrade-guide). |
Oops, something went wrong.