docs: Add nullability checks article for JSpecify annotations#5212
docs: Add nullability checks article for JSpecify annotations#5212
Conversation
Add comprehensive documentation for type-parameter-level nullability checks using JSpecify annotations in Vaadin Flow. Covers: - Overview of JSpecify and type parameter nullability pattern - Benefits of compile-time null safety - @NullMarked annotation for class and package levels - Static analysis with NullAway - Current usage in Signal APIs with examples - Working with nullable and non-null signals - Custom generic classes with nullable type parameters - List and collection type nullability - Best practices for null safety Based on PR vaadin/flow#23630 which introduced type-parameter-level nullability for Signal APIs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
I wonder if need to document NullAway plugin and compiler config as the must-have option, see https://github.com/vaadin/signals-cases/blob/45334f4655a895dce48c4260a30af69af15557bf/pom.xml#L101 ? |
|
This looks like the specific documentation for generic type nullability, but we have no nullability documentation to base it on as far as i could find. IMO we need docs about nullability annotations, what they are, how you can enable them in your project, and that Vaadin has them currently enabled for signals only. That they are used for generic types is one detail, similar to that they are used for parameter types and return types |
|
For projects we should probably suggest the maven/gradle plugin + JDK >= 22 instead of a lot of custom options |
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-5212.fly.dev Built from d7222a1 |
Rewrite the JSpecify nullability article based on PR review feedback. The article now covers nullability annotations in general (parameters, return types, and type arguments) instead of focusing narrowly on generic type parameter nullability. Adds project setup instructions using nullability-maven-plugin and gradle-errorprone-plugin with JDK 22+ requirement. Renames file from type-parameter-nullability.adoc to nullability.adoc to reflect the broader scope.
|
Expanded the doc to be about nullability in general and not only type parameters |
Frame enabling null checking as: (1) always recommended for checking Vaadin types, with a concrete SignalExample showing what the compiler catches, and (2) optional extension to your own code via package-level @NullMarked. Also removes JSpecify dependency section since it is included automatically.
Add comprehensive documentation for type-parameter-level nullability checks using JSpecify annotations in Vaadin Flow. Covers:
Based on PR vaadin/flow#23630 which introduced type-parameter-level nullability for Signal APIs.
🤖 Generated with Claude Code