Skip to content

ref: change names in serinus_inertia package - #1

Merged
kingwill101 merged 3 commits into
mainfrom
ref/naming_conventions
Apr 3, 2026
Merged

kingwill101 merged 3 commits into
mainfrom
ref/naming_conventions

Conversation

@francescovallone

@francescovallone francescovallone commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor

    • Simplified and unified configuration naming and updated module wiring for cleaner configuration handling.
  • Bug Fixes

    • Clearer error raised when the Inertia service is unavailable.
    • Request handling now uses the full request header map for more reliable header access.
  • Tests

    • Unit tests updated to align with configuration and header handling changes.

@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 6b2046de-772f-4ea9-832a-6a3fd8603507

📥 Commits

Reviewing files that changed from the base of the PR and between c5b106b and 8fe0ea4.

📒 Files selected for processing (2)
  • packages/serinus_inertia/lib/src/serinus_inertia.dart
  • packages/serinus_inertia/test/unit/serinus_inertia_test.dart

📝 Walkthrough

Walkthrough

Configuration classes in serinus_inertia were renamed to drop the "Serinus" prefix (e.g., SerinusInertiaOptions → InertiaOptions). DI provider types updated to provide InertiaOptions. extractSerinusHeaders was removed; request headers are taken via request.headers.asFullMap(). inertiaService now throws StateError if absent.

Changes

Cohort / File(s) Summary
Core library renames & API updates
packages/serinus_inertia/lib/src/serinus_inertia.dart
Renamed SerinusInertiaOptions → InertiaOptions, SerinusInertiaAssetOptions → InertiaAssetsOptions, SerinusInertiaSsrOptions → InertiaSsrOptions. Updated constructors, copyWith types, InertiaService/InertiaSsrProcessManager/InertiaModule to use InertiaOptions. Provider.forValue provides InertiaOptions with isGlobal: true. Removed extractSerinusHeaders; inertiaRequestFromSerinus now uses request.headers.asFullMap() and request.path. SerinusInertiaRequestContextExtension.inertiaService now throws StateError when missing.
Example update
packages/serinus_inertia/example/lib/app_module.dart
Replaced usage of SerinusInertiaOptions/SerinusInertiaAssetOptions with InertiaOptions/InertiaAssetsOptions in InertiaModule configuration.
Tests updated to match API changes
packages/serinus_inertia/test/unit/serinus_inertia_test.dart
Replaced extractSerinusHeaders(...) assertions with headers.asFullMap() checks. Updated test fixtures to inject InertiaService via providers and to use InertiaOptions/InertiaAssetsOptions/InertiaSsrOptions in all instantiations. No behavioral test expectations changed beyond API/type updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through names, dropped a long tag,
Cleared the headers, no extra bag,
Providers set, I gave a stare —
If service sleeps, I cry "beware!"
A tiny hop, all tidy and spry 🥕


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@kingwill101
kingwill101 merged commit cf84f03 into main Apr 3, 2026
3 checks passed
@kingwill101
kingwill101 deleted the ref/naming_conventions branch April 3, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants