Skip to content

docs: Add nullability checks article for JSpecify annotations#5212

Open
mshabarov wants to merge 1 commit intomainfrom
nullability-article
Open

docs: Add nullability checks article for JSpecify annotations#5212
mshabarov wants to merge 1 commit intomainfrom
nullability-article

Conversation

@mshabarov
Copy link
Contributor

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

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>
@mshabarov
Copy link
Contributor Author

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 ?

@Artur-
Copy link
Member

Artur- commented Mar 3, 2026

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

@Artur-
Copy link
Member

Artur- commented Mar 3, 2026

For projects we should probably suggest the maven/gradle plugin + JDK >= 22 instead of a lot of custom options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎Iteration reviews

Development

Successfully merging this pull request may close these issues.

2 participants