Skip to content

refactor(view): drop named-view sugar, converge to L13 flushState (task 2.14) - #52

Merged
agissept merged 1 commit into
pre-release/4.2.94from
migration/2.14-view-strict-mode
Sep 16, 2026
Merged

agissept merged 1 commit into
pre-release/4.2.94from
migration/2.14-view-strict-mode

Conversation

@agissept

Copy link
Copy Markdown
Member

Task 2.14 — View strict-mode tighten [fork]

Menyesuaikan View\Factory ke surface L13 (strict-mode: idiom lama → method-not-found, memaksa app conform).

Fork

  • Hapus named-view sugar (dihapus di L13): of(), name(), alias(), getNames() + properti $names/$aliases + normalisasi alias di make().
  • Rename flush ke nama L13: tambah flushState() (pegang renderCount, delegasi ke flushSections), rename flushSectionsIfDoneRendering()flushStateIfDoneRendering(). flushSections() tetap (sections-only, seperti trait ManagesLayouts L13). Update pemanggil di View::render().
  • Keep BladeCompiler::extend() (tidak di-strip pre-swap).

Verifikasi

vendor/bin/phpunit tests/View/OK (121 tests, 193 assertions). PHP lint 4 file bersih. Nol sisa referensi method/properti yang dihapus di seluruh src/.

Sisi app (terpisah, repo dicoding)

Blade::extend (2 callsite di DicodingServiceProvider) → Blade::directive() = konvergensi, tidak dipaksa (extend() dipertahankan). Dikerjakan lockstep di branch improvement/l13-migration/view-conform.

Urutan

Stacked di atas #48 (tip stack saat ini: #45#46#48ini). Blocker (1.1 Contracts) sudah ✅.

🤖 Generated with Claude Code

…sk 2.14)

Strict-mode tighten of View\Factory to the L13 surface:

- Remove named-view sugar removed in L13: `of()`, `name()`, `alias()`,
  `getNames()` + the `$names`/`$aliases` properties and the alias
  normalization in `make()`. Any surviving caller is now method-not-found
  (PHP+Psalm) — the forcing function for app conform.
- Rename render-flush to L13 names: add `flushState()` (owns renderCount +
  delegates to flushSections), rename `flushSectionsIfDoneRendering()` ->
  `flushStateIfDoneRendering()`; `flushSections()` stays (sections-only, as
  in L13's ManagesLayouts). Update View::render() callers.
- Keep `BladeCompiler::extend()` (not stripped pre-swap).

Tests: drop the 3 obsolete Factory tests (named views / alias make);
retarget View flush mocks to flushStateIfDoneRendering. tests/View green
(121 tests, 193 assertions).

App side (separate, in dicoding repo): 2 `Blade::extend` -> `Blade::directive()`
is convergence, not forced (extend() kept).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@agissept agissept self-assigned this Sep 15, 2026
Base automatically changed from migration/2.7-config-getenvironment to pre-release/4.2.93 September 16, 2026 02:58
@agissept
agissept changed the base branch from pre-release/4.2.93 to pre-release/4.2.94 September 16, 2026 03:04
@agissept
agissept merged commit 9d7bf40 into pre-release/4.2.94 Sep 16, 2026
2 checks passed
@agissept
agissept deleted the migration/2.14-view-strict-mode branch September 16, 2026 03:05
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.

1 participant