Comments (3)
Per a call with Eric, this structure may work with more modern PHP frameworks:
Eric's point is that service
in the PHP community and components
also works for the same thing. My pushback was that a "component" should have one class, but the way I'm doing it you could use multiple classes, so we went with component.
from wpkickstart.
Some notes after talking to Jeremy:
features
is usually a name for testing things in PHP communitycomponents
could also be packages (not as in a name, but as in a concept, and should be installed like so viacomposer
). Note, the structure would allow for it, we would need to get composer to install things there- Expecting a
src/
folder (not sure I would want to do that) - Directory structure is not deep enough (we're intentionally steering away from deep structures to reduce complexity)
from wpkickstart.
- The official name for "components" can be
components/
but maybe make this filterable so someone can name it somethings else? - The official name for "features" should be
services/
but can also be calledfeatures/
for backwards compatibility - The
includes/
folder should be renamed toapp/
as in #11
So what you end up with is:
services|features/
(can either nameservices/
orfeatures/
butservices/
is what's right be default)name/
(e.g.migrate-subsite
)class-name.php
(e.g.class-migrate-subsite.php
)
components/
name/
(e.g.cli
)class-name.php
(e.g.class-cli.php
)
app/
class-app.php
(always this name for theapp()
function)
Note some interesting changes w/ Namespace thinking:
components/
should be namespaced independent of the plugin framework so they can be mobile- Document this in the folder that they should be attached by their root namespace or using a
use
statement in-file
- Document this in the folder that they should be attached by their root namespace or using a
services/
should be namespaced the same as the rest of the plugin framework
from wpkickstart.
Related Issues (20)
- allow new Class() anywhere
- Rename includes to app/ HOT 1
- Better composer integration HOT 1
- Add wpcli commands for replacements HOT 2
- Keep all WIKI documentation in /docs HOT 1
- Check tests HOT 1
- Add ES6 Support HOT 1
- Add SASS Support HOT 1
- Allow multiple word classes with a -
- Consider PSR4 HOT 2
- Services should auto-attach.
- Components should be individual packages.
- Release 2.0.1 HOT 1
- Possible closing of wpkickstart for OopsWP
- Bring in all boilerplate improvements from RC HOT 3
- 1.2
- $app cannot be called that, it must be unique since it's global variable.
- Re-work to be component/feature organized HOT 3
- Add autorun feature HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpkickstart.