Skip to content

Commit a8c2205

Browse files
committed
docs: ✏️ Document changes related to Scala 3
1 parent 650e660 commit a8c2205

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ See also the [CHANGELOG](https://github.com/cucumber/cucumber-jvm/blob/master/CH
1111

1212
### Added
1313

14+
- [Scala] Support Scala 3 RC1
15+
- Check out the [v7.x upgrade guide](./docs/upgrade_v7.md)
16+
1417
### Changed
1518

1619
- [Build] Use Github Actions instead of Travis CI

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The minor version might differ because Cucumber Scala may add Scala-related feat
2525

2626
- [Installation](./docs/install.md)
2727
- Upgrade notes
28+
- [Version 7.x](docs/upgrade_v7.md)
2829
- [Version 6.x](docs/upgrade_v6.md)
2930
- [Version 5.x](docs/upgrade_v5.md)
3031
- Documentation

docs/upgrade_v7.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Upgrading from 6.x to 7.x
2+
3+
Upgrading from v6 should be straightforward.
4+
Prior to upgrading to v7.0.0 upgrade to latest v6.x and stop using all deprecated features.
5+
Some features will log a deprecation warning.
6+
7+
See also:
8+
- [Cucumber Scala CHANGELOG](../CHANGELOG.md)
9+
10+
## Scala 3 support
11+
12+
This release brings Scala 3 support.
13+
14+
### Syntactic changes
15+
16+
If you use Scala 3, you might need to change slightly some of your glue code:
17+
- parenthesis are now necessary even around a single-argument step or hook definition
18+
```scala
19+
// Won't compile anymore
20+
Given("Something {}") { str: String =>
21+
// ...
22+
}
23+
24+
// Instead use:
25+
Given("Something {}") { (str: String) =>
26+
// ...
27+
}
28+
```
29+
- hooks must explicitly return `Unit` (most of the time you already had compile errors with such statements in Scala 2.x as well)
30+
```scala
31+
Before {
32+
// ... // Some code not retuning Unit
33+
() // Explicit Unit
34+
}
35+
```
36+
37+
### Other changes
38+
39+
The line numbers provided in reports might slightly change
40+
from start of a step definition to end of a step definition in some cases.
41+
In case of errors, these line numbers should be more accurate than before.

0 commit comments

Comments
 (0)