Skip to content

Commit

Permalink
Docs and bump typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Jul 24, 2023
1 parent 009e4c4 commit 686b827
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
34 changes: 34 additions & 0 deletions docs/source/upgrade-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,40 @@ or use Webpack plugins, you might need to make adjustments.
Razzle has been upgraded to version `4.2.18`.
It is recommended that you update your project's dependency on Razzle to this version in order to avoid duplication.

### TypeScript support in Volto

```{versionadded} 17.0.0-alpha.22
We have now full support of TypeScript in Volto core.
No existing code has been migrated.
You still have the freedom to develop using JavaScript, it's your choice if you want to do it in TypeScript.
In the past, you could add TypeScript support for Volto add-ons.
It's also available for projects too now if you upgrade dependencies (see next section).
```

You should update your projects if you want to support TypeScript in your projects as well.

Changes in your `package.json`:

```diff
"devDependencies": {
+ "@plone/scripts": ^3.0.0,
+ "@typescript-eslint/eslint-plugin": "5.57.1",
+ "@typescript-eslint/parser": "5.57.1",
+ "stylelint-prettier": "1.1.2",
+ "ts-jest": "^26.4.2",
+ "ts-loader": "9.4.2",
+ "typescript": "5.1.6"
}
```

### Upgrade ESlint and use `@babel/eslint-parser`

ESlint uses a library to parse the language under analysis.
The one used was long deprecated and didn't supported both TypeScript and JavaScript.
We upgraded the ESlint parser to use `@babel/eslint-parser`.
This means that could be that when you upgrade your projects, some new violations appear in your project.
Once upgraded, run the linters again to make sure that your code is free of violations.

### `BlockChooser` component now uses `popperjs` internally

Technically not a breaking, the API nor the component contract has changed, but it's worth noting this change in here.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
"tmp": "0.2.1",
"ts-jest": "^26.4.2",
"ts-loader": "9.4.2",
"typescript": "5.0.3",
"typescript": "5.1.6",
"use-trace-update": "1.3.2",
"why": "0.6.2"
},
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,7 @@ __metadata:
tmp: 0.2.1
ts-jest: ^26.4.2
ts-loader: 9.4.2
typescript: 5.0.3
typescript: 5.1.6
undoo: 0.5.0
universal-cookie: 4.0.4
universal-cookie-express: 4.0.3
Expand Down Expand Up @@ -24593,23 +24593,23 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:5.0.3":
version: 5.0.3
resolution: "typescript@npm:5.0.3"
"typescript@npm:5.1.6":
version: 5.1.6
resolution: "typescript@npm:5.1.6"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 3cce0576d218cb4277ff8b6adfef1a706e9114a98b4261a38ad658a7642f1b274a8396394f6cbff8c0ba852996d7ed2e233e9b8431d5d55ac7c2f6fea645af02
checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350
languageName: node
linkType: hard

"typescript@patch:typescript@5.0.3#~builtin<compat/typescript>":
version: 5.0.3
resolution: "typescript@patch:typescript@npm%3A5.0.3#~builtin<compat/typescript>::version=5.0.3&hash=a1c5e5"
"typescript@patch:typescript@5.1.6#~builtin<compat/typescript>":
version: 5.1.6
resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=a1c5e5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 9ec0a8eed38d46cc2c8794555b7674e413604c56c159f71b8ff21ce7f17334a44127a68724cb2ef8221ff3b19369f8f05654e8a5266621d7d962aeed889bd630
checksum: 21e88b0a0c0226f9cb9fd25b9626fb05b4c0f3fddac521844a13e1f30beb8f14e90bd409a9ac43c812c5946d714d6e0dee12d5d02dfc1c562c5aacfa1f49b606
languageName: node
linkType: hard

Expand Down

0 comments on commit 686b827

Please sign in to comment.