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

fix: update upgrading_an_app page for JHipster 8 #1326

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ yarn-error.log*

# IDEA
/.idea

# NetBeans
nbproject/

34 changes: 20 additions & 14 deletions docs/core-tasks/upgrading-an-application.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ last_update:
date: 2024-04-08T00:00:00-00:00
---

## Option 1 - automatic upgrade
# <i class="fa fa-level-up"></i> Upgrading an application

When a new version of JHipster is released, the JHipster upgrade sub-generator helps upgrade an existing application to this new version, without erasing your changes.
## Summary

1. [Option 1 - Automatic Upgrade](#option-1---automatic-upgrade)
2. [Option 2 - Manual Upgrade](#option-2---manual-upgrade)

## Option 1 - Automatic Upgrade

This is helpful to:

- Have the latest JHipster features in an existing application
- Get the changes when there is an important bug fix or security update
- Retain your changes in your codebase, and merge them with newly generated code
* Have the latest JHipster features in an existing application
* Get the changes when there is an important bug fix or security update
* Retain your changes in your codebase, and merge them with newly generated code

:::warning

Expand All @@ -30,7 +35,7 @@ For this sub-generator to work you need to have `git` installed from [http://git

Go into the application's root directory:

`cd myapplication/`
`cd myJHipsterProject/`

To upgrade your application, type:

Expand Down Expand Up @@ -63,9 +68,9 @@ For a working example, see the following pull requests from the 21-Points Health

Here is how the upgrade process works graphically (read the sections below to have a textual explanation):

![GitGraph](/images/upgrade_gitgraph.png)
![Git graph showing each invocation of 'npx jhipster upgrade' and the commits on jhipster_upgrade branch](/upgrading-an-application/images/upgrade_gitgraph.png)

(this image comes from [JSFiddle](http://jsfiddle.net/lordlothar99/tqp9gyu3/) )
[Raw .mermaid file](/upgrading-an-application/jhipster_upgrade.mermaid)

Please note that the `jhipster_upgrade` branch will be created orphan on your project, although it doesn't display correctly on the above graph.

Expand Down Expand Up @@ -97,23 +102,24 @@ On the first run of the JHipster upgrade sub-generator, in order to avoid erasin

#### Advice

- Don't commit anything on the `jhipster_upgrade` branch. This branch is dedicated to the JHipster upgrade sub-generator: each time the sub-generator is run, a new commit will be created.
* Don't commit anything on the `jhipster_upgrade` branch. This branch is dedicated to the JHipster upgrade sub-generator: each time the sub-generator is run, a new commit will be created.

- If you are updating from a very old version (example from 5.0.0 to latest) we suggest updating gradually between each minor/patch version and performing tests to make sure the application works as expected.
* If you are updating from a very old version (example from 5.0.0 to latest) we suggest updating gradually between each minor/patch version and performing tests to make sure the application works as expected.

- There are some helpful approaches from the JHipster community around designing the application in such a way that makes the update process easier, and reduces the amount of merge conflicts. We recommend using [JHipster Side-by-Side approach](https://www.youtube.com/watch?v=Gg5CYoBdpVo).
* There are some helpful approaches from the JHipster community around designing the application in such a way that makes the update process easier, and reduces the amount of merge conflicts. We recommend using [JHipster Side-by-Side approach](https://www.youtube.com/watch?v=Gg5CYoBdpVo).

## Option 2 - manual upgrade
## Option 2 - Manual Upgrade

For a manual upgrade, first upgrade your version of JHipster with:

```shell
npm install -g generator-jhipster
```

Delete your project `node_modules` folder and then run:
Delete your project `node_modules` folder and then run `jhipster`:

```shell
rm -rf node_modules
jhipster
```

Expand All @@ -123,7 +129,7 @@ You can also update your project and all its entities by running
jhipster --force
```

You can also update your entities one-by-one by running again the entity sub-generator, for example if your entity is named _Foo_
You can also update your entities individually by running the `entity` sub-generator, i.e., if your entity is named _Foo_:

```shell
jhipster entity Foo
Expand Down
6 changes: 6 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const config: Config = {
redirectsPlugin,
'./src/plugins/google-fonts.ts',
'./src/plugins/module-details.ts',
'plugin-image-zoom'
],

themeConfig: {
Expand Down Expand Up @@ -134,6 +135,11 @@ const config: Config = {
// Temporary disabled, need setup https://docusaurus.io/docs/search#algolia-troubleshooting
contextualSearch: false,
},
imageZoom: {
// CSS selector to apply the plugin to, defaults to '.markdown img'
// exclude images from zoom with "italicized" markdown, e.g., _![](/img/portal/new.png)_
selector: '.markdown :not(em) > img'
},
} satisfies Preset.ThemeConfig,

headTags: [
Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"embla-carousel-auto-scroll": "^8.1.5",
"embla-carousel-react": "^8.1.5",
"fetch-jsonp": "^1.3.0",
"plugin-image-zoom": "^1.2.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand Down
Binary file removed static/images/upgrade_gitgraph.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions static/upgrading-an-application/jhipster_upgrade.mermaid
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
%%{init: { 'logLevel': 'debug', 'theme': 'default', 'themeVariables': {
'git0': '#004677',
'git1': '#236fa4',
'git2': '#236fa4',
'gitBranchLabel1': '#ffffff',
'gitBranchLabel2': '#ffffff'
} } }%%
gitGraph LR:
branch jhipster_upgrade
branch "each 'npx jhipster upgrade'"
checkout main
commit id: "chore: initial commit" tag: "1.0.0"
commit id: "feat: controller" tag: "1.1.0"
checkout jhipster_upgrade
commit id: "7.9.4"
checkout main
merge jhipster_upgrade type: HIGHLIGHT
checkout jhipster_upgrade
commit id: "8.0.0"
checkout main
merge jhipster_upgrade tag: "1.2.0"
commit id: "fix: cool patch" tag: "1.2.1"
commit id: "docs: update variable"
checkout jhipster_upgrade
commit id: "8.0.0'"
checkout main
merge jhipster_upgrade type: HIGHLIGHT
checkout jhipster_upgrade
commit id: "8.1.0"
checkout main
merge jhipster_upgrade tag: "1.3.0"
commit id: "fix: another cool patch" tag: "1.3.1"
commit id: "feat: another controller" tag: "1.4.0"
checkout jhipster_upgrade
commit id: "8.1.0'"
checkout main
merge jhipster_upgrade type: HIGHLIGHT
checkout jhipster_upgrade
commit id: "8.1.1"
checkout main
merge jhipster_upgrade tag: "1.5.0"
commit id: "test: controller"