Initial review thoughts

Aperta
#1 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

This is a set of open design questions rather than a defined change: whether to match Core's one-class-per-domain shape instead of one WP_Ability subclass per ability, whether to ship an autoloader so the newest copy of the package wins, and which namespaces (wp, core, wordpress) content write abilities should use. Read the package docs on namespaces and the migrated content write abilities first. Done means maintainers reach a decision on each point, and the outcome is recorded in the issue or in follow-up issues.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Figured it might be better to drop this here than as a comment in Slack. This is just some thoughts I had doing an initial review, feel free to disregard any of these though :)

Match WordPress Core's ability shape

This may not be the main goal here but if we want to eventually port Abilities into WordPress Core, it may be easier to do that if our structure matches Core's structure. The main difference here is Core ships one class per domain and we use one WP_Ability subclass per ability, each of which implements a bunch of abstract methods.

I think this is a cleaner approach and does match more closely what we do in the AI plugin but doesn't match what Core does. So potentially a decision point to make here on how we want to proceed.

Should we ship an autoloader?

Right now we put the loading of things on the consumer. I'm mostly okay with this but it does mean if someone is using multiple plugins that utilize this package, whichever plugin loads first wins (meaning you could end up with missing abilities or older abilities).

Wondering if we should ship a small autoloader, like Action Scheduler, that ensures the "newest" version of the package always wins if multiple copies are loaded.

Should the content write abilities use core or wp as the namespace?

The content write abilities that were migrated from the AI plugin use the core namespace, though the documentation in this package say you should use wp until a core proposal has landed. Not a big deal but a mismatch between code and docs.

And personal opinion, not sure we need wp, core and wordpress as namespaces here. Likely fine to have just wp and core, though maybe I'm missing a use case? Just don't want to overcomplicate things out of the box (I feel like some of the process docs we have here are already getting a bit complex for an initial version of things).

Lingua principale
PHP
Stelle
4
Fork
4
Merge medio
2g 8h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WordPress/abilities

Tutte le issue di WordPress/abilities

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.