Remove Fractal - #2523
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe API moved from Fractal transformers to ChangesPanelResponse migration
Merge Risk: ⚪ Minimal · up to The PR removes unused Fractal code and dependency while replacing documentation inference, with API fixtures unchanged and relevant test suites passing; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8675649 to
a895544
Compare
a895544 to
749034b
Compare
f047b9b to
f67b060
Compare
f67b060 to
f6440a1
Compare
f6440a1 to
9349e21
Compare
0ecbc9e to
31643bb
Compare
31643bb to
83acf73
Compare
83acf73 to
742c4f7
Compare
Removes app/Transformers, the custom Fractal wrapper and PanelSerializer, the config file, and the three Fractal specific Scramble extensions, and drops spatie/laravel-fractal from composer. A new PanelResponseTypeInfer extension documents PanelResponse endpoints instead, deriving attribute schemas from the Data class properties including MapOutputName renames and Optional keys, and reproducing the envelope, pagination, and addMeta shapes the old extension modeled. Test helpers that compared responses against transformer output now build their expected attributes through the Data classes, the same path the envelope takes in production. The contract freeze suite passes untouched, the full Integration and Unit suites are green, and ApiDocumentationTest passes against the new inference.
aa2af6a to
51d329a
Compare
Final step of the API contract freeze stack (#2520 → #2521 → this). Both predecessors are merged: the wire format is pinned by the fixture suite and every endpoint renders through the laravel-data layer, so nothing uses Fractal anymore. This PR deletes it. Net −2,424 lines, and almost all of it is pure removal.
What's removed
app/Transformers/**Extensions/Spatie/Fractalistic/Fractal,Extensions/League/Fractal/Serializers/PanelSerializerconfig/fractal.phpspatie/laravel-fractaland itsleague/fractalchainFractalResponseTypeInfer,TransformerFactoryTypeInfer,TransformerModelBindingExtensionWhat replaces it
One new class,
app/Extensions/Dedoc/Scramble/PanelResponseTypeInfer.php, takes over API doc generation from the three deleted Scramble extensions. It follows thePanelResponsefluent chain and derives attribute schemas from the Data class properties, covering:MapOutputNamerenamesOptionalkeysaddMetashapes as beforeSuggested review order
PanelResponseTypeInfer.php: the only file with new logic (373 lines).ApplicationApiController,ClientApiController,BackupController,AppServiceProvider, which just drop the Fractal wiring.assertJsonTransformedWithand friends now build expected attributes through the Data classes, the same container path the envelope takes in production.Verification
ApiDocumentationTestpasses against the new inferenceKnown tradeoff
Array-shaped fields like
limitsnow document as generic arrays rather than keyed objects, since the reflection doesn't parse array-shape docblocks. The old extension occasionally did better there; parsing those docblocks is the upgrade path if it matters. Runtime responses are unaffected, this is docs-only.