Skip to content

refactor(core): replace [Event] attribute with [FromEvent]#250

Merged
j-d-ha merged 3 commits into
mainfrom
refactor/#249-deprecate-Event]-attribute-in-favor-of-FromEvent]
Dec 15, 2025
Merged

refactor(core): replace [Event] attribute with [FromEvent]#250
j-d-ha merged 3 commits into
mainfrom
refactor/#249-deprecate-Event]-attribute-in-favor-of-FromEvent]

Conversation

@j-d-ha

@j-d-ha j-d-ha commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

🚀 Pull Request

📋 Summary

Deprecates the [Event] attribute in favor of the new [FromEvent] attribute to follow .NET naming conventions and prevent conflicts with System.Diagnostics.Tracing.EventAttribute.

Key changes:

  • Added new [FromEvent] attribute as the recommended approach
  • Marked [Event] as obsolete with a descriptive message
  • Updated all documentation, examples, and tests to use [FromEvent]
  • Source generator now recognizes both attributes for backward compatibility

✅ Checklist

  • My changes build cleanly
  • I've added/updated relevant tests
  • I've added/updated documentation or README
  • I've followed the coding style for this project
  • I've tested the changes locally (if applicable)

🧪 Related Issues or PRs

Closes #249


💬 Notes for Reviewers

  • The old [Event] attribute remains functional (marked obsolete) to maintain backward compatibility
  • Users will receive a compiler warning when using [Event], guiding them to use [FromEvent]
  • All envelope package READMEs and documentation have been updated
  • Version bumped to 2.0.0-beta.8 in Directory.Build.props

- Updated handler registration examples and documentation to adopt `[FromEvent]` naming convention.
- Adjusted source code, unit tests, and snapshots to reflect the replacement of the `[Event]` attribute.
- Marked the `[Event]` attribute as obsolete and added a warning to nudge users towards `[FromEvent]`.
- Verified correct handling and diagnostics to ensure one `[FromEvent]` annotation per Lambda handler.
- Updated version in Directory.Build.props from 2.0.0-beta.7 to 2.0.0-beta.8.
…mentation

- Removed redundant `<code>` tag in the example usage of the `[Event]` attribute.
@github-actions github-actions Bot added the type: refactor Code refactoring label Dec 15, 2025
@j-d-ha j-d-ha changed the title refactor(builder): replace [Event] attribute with [FromEvent] refactor(core): replace [Event] attribute with [FromEvent] Dec 15, 2025
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Dec 15, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #250      +/-   ##
==========================================
- Coverage   88.31%   88.23%   -0.09%     
==========================================
  Files         127      127              
  Lines        3013     2991      -22     
  Branches      337      337              
==========================================
- Hits         2661     2639      -22     
  Misses        219      219              
  Partials      133      133              
Files with missing lines Coverage Δ
...inimalLambda.Envelopes/BaseHttpResultExtensions.cs 100.00% <100.00%> (ø)
...es/MinimalLambda.Envelopes/HttpResultExtensions.cs 100.00% <100.00%> (ø)
...ourceGenerators/Diagnostics/DiagnosticGenerator.cs 94.73% <100.00%> (ø)
...malLambda.SourceGenerators/Models/ParameterInfo.cs 95.65% <ø> (ø)
...ng/LambdaApplicationFactoryContentRootAttribute.cs 0.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4afcbbb...3b89389. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@j-d-ha
j-d-ha merged commit f1d9e81 into main Dec 15, 2025
10 of 11 checks passed
@j-d-ha
j-d-ha deleted the refactor/#249-deprecate-Event]-attribute-in-favor-of-FromEvent] branch December 15, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(abstractions): deprecate [Event] attribute in favor of [FromEvent]

1 participant