Skip to content

Pre-release 4.2.98 → master — task 4.1 SCC-1 seed phase - #68

Open
agissept wants to merge 4 commits into
pre-release/4.2.97from
pre-release/4.2.98
Open

agissept wants to merge 4 commits into
pre-release/4.2.97from
pre-release/4.2.98

Conversation

@agissept

Copy link
Copy Markdown
Member

Task 4.1 — SCC-1 seed phase (5 package, app-transparent)

Swap komponen fork yang tak ada di blok replace fork ke real illuminate/*:^13, lalu hapus tree yang di-shadow di disk. Namespace & public API identik → tak butuh conform app.

commit package
4.1a illuminate/contracts:^13 (hapus src/Illuminate/Contracts/, 45 file)
4.1b illuminate/macroable + illuminate/conditionable:^13
4.1c illuminate/collections:^13
4.1d illuminate/reflection:^13

Kenapa aman

  • Kelimanya autoload prefix Illuminate\Support\ => "" (kecuali Contracts) — composer resolve longest-prefix-first, jadi package cuma shadow path yang benar-benar dia ship; sisanya tetap ke tree fork.
  • helpers.php/functions.php fork dipertahankan (54 dari 59 global itu fork-only; 5 yang overlap resolve ke package karena dependency file di-load duluan).
  • Convergence yang dipaksa swap (semua mekanikal, di src fork): #[\Override] sweep, Arr::build/Arr::fetch di-inline ke global array_build/array_fetch, Collection::fetchpluck di Query\Builder::pluck().

Fork suite hijau di tiap commit.

Stack

Stacked-PR (belum ada yang di master):
master#64 (4.2.96 / task 2.5) ← #67 (4.2.97 / task 4.0 vendor-floor) ← PR ini (4.2.98 / 4.1 seed).

Merge urut: #64#67 → PR ini, lalu tag 4.2.98. SCC-1 core cutover (window atomik) menyusul di 4.2.99.

…13 (task 4.1a)

Wave 4.1 opening move. Fork's on-disk src/Illuminate/Contracts/ (45 files) is
replaced by the real illuminate/contracts v13.32.0 package.

Mechanism correction to MIGRATION-SPLIT-MAP.md §3a: the "copy-source-EARLY"
premise (composer require rejected because the package is fork-provided) does
NOT hold for contracts/collections/macroable/conditionable/reflection/pipeline
— none of them are in fork's `replace` block (27 entries). Plain
`composer require` works; only the shadowing on-disk tree needs deleting.

Two fork concretes had to be converged onto the newer package interfaces:
- Container: add $scopedInstances + scoped()/scopedIf() (v13 interface)
- ResponseFactory: 10 throwaway glue methods (noContent, file, streamJson,
  streamDownload, eventStream, redirect*). Fork RF is deleted when
  illuminate/routing v13 swaps in, so these are minimal — missing deps
  (Js/StreamedEvent/StreamedResponseException/report) inlined, redirect*
  resolves 'redirect' lazily from the container.

Verified: contracts resolve from vendor/illuminate/contracts (not src/),
suite 1647 green / 3659 assertions.
…k 4.1b)

Second Wave 4.1 slice, same mechanism as 4.1a: neither package is in fork's
`replace` block, so plain composer require works.

illuminate/macroable + illuminate/conditionable both autoload
"Illuminate\Support\" => "" — the same prefix fork uses for
src/Illuminate/Support/. Composer resolves longest-prefix-first with fallback,
so the packages only shadow what they actually ship. Verified:

  Traits\Macroable             -> vendor/illuminate/macroable
  Traits\Conditionable         -> vendor/illuminate/conditionable
  HigherOrderWhenProxy         -> vendor/illuminate/conditionable
  Collection / Str / Reflector -> src/Illuminate/Support (fork, untouched)

Three fork files are now dead (shadowed) and deleted. MacroableTrait.php is
kept as the BC alias shim (drops at the flip).

Suite 1647 green / 3659 assertions.
…4.1c)

Third Wave 4.1 slice. illuminate/collections autoloads "Illuminate\Support\"
=> "" plus files [functions.php, helpers.php], so it shadows exactly the 10
fork files it duplicates; the other 53 under src/Illuminate/Support survive
(longest-prefix-first with fallback). Eight of those were classes and are
deleted; helpers.php/functions.php are KEPT because 54 of the fork's 59 global
helpers are fork-only — both sides guard every function with function_exists,
so the 5 overlapping names (data_get, enum_value, head, last, value) resolve to
the package's, which now load first.

Task 3.3b had already converged Collection/Arr to L13 shape, so the swap came
down to four 4.2-only APIs the package does not have. Swept every Arr:: call in
fork src against v13's Arr (59 methods) — only build/fetch were missing:

- array_build()/array_fetch() globals now inline their bodies instead of
  delegating to the removed Arr::build/Arr::fetch. Consumers are Routing\Route
  and Database\Eloquent\Collection, plus seven app-side test call sites of
  array_fetch.
- Database\Query\Builder::pluck() now uses Collection::pluck (upstream's own
  implementation) instead of the removed Collection::fetch.
- Eloquent\Collection::fetch() keeps its body (it rides the array_fetch global)
  but loses its #[\Override], which is now false since v13's base Collection
  dropped fetch(). Found by sweeping all 177 #[\Override] in fork src — 100
  files clean, this was the only mismatch.

Collection::lists() has zero callers in fork src and zero in the app, so the
four tests covering it move to pluck()/->all() (names follow upstream). Two Arr
tests covered v13-differing behaviour and were converged: Arr::exists on an
Enumerable now goes through Collection::has (array_key_exists semantics), and
Arr::shuffle lost its seed parameter so testShuffleWithSeed is dropped. The
test stub TestAccessorEloquentTestStub gains the __isset upstream has.

Suite 1646 green / 3658 assertions.
Last copy-source seed from MIGRATION-SPLIT-MAP §3a. Fork's 947-byte
src/Illuminate/Support/Reflector.php stub (a single getParameterClassName,
itself copied from Container\Util) is shadowed by the real package, which is a
strict superset (getClassAttribute(s), getParameterClassNames, isCallable,
isParameterSubclassOf, isParameterBackedEnumWithStringBackingType).

The package's helpers.php defines lazy()/proxy(); no overlap with the fork's
globals, and every function is function_exists-guarded on both sides.

Suite 1646 green / 3658 assertions.

Seeds complete (Contracts, Macroable, Conditionable, Collections, Reflection).
Next is §1: the eleven-member SCC-1 window.
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