Comments (4)
I think it's a long (possibly painful) story why it's implemented this way.
@scruffian might be able to tell you more.
from gutenberg.
This is what I did at first but then we moved it back: #57979
See also:
https://core.trac.wordpress.org/ticket/59867#comment:4
#58429
In summary, there are several competing wishes...
On the one hand we want to put code into private functions inside classes so that they can't be used elsewhere in WordPress which would give us a larger surface to maintain with respect to backwards compatibility. Static classes are a good way to achieve this.
On the other hand, at the moment all the PHP rendering code for blocks lives in the block library package, and is back-ported automatically. We are reluctant to start moving block specific code outside of this package.
An ideal solution would allow us to keep all the PHP code inside the block-library package, and also to find a mechanism to keep functions clearly namespaced and not exposed globally for everyone to use. PHP namespaces could be an alternative to a static class.
from gutenberg.
I‘m not suggesting to move this class out of the package, just into a separate file next to index.php. That doesn‘t change anything about the API surface at all.
from gutenberg.
I think that would be great but it involves making some changes to the way that the PHP files are built for the block library package. Hopefully someone is able to work on that soon!
from gutenberg.
Related Issues (20)
- Indent/Outdent toolbar buttons: show shortcut in tooltip HOT 2
- E2E: Eliminate side effects via DB snapshots HOT 7
- Could not removeFilter (Javascript) HOT 1
- Code editor mode only allows template (not content) editing when editing a "Page" with the site editor
- Allow customization of post-template block markup
- Add tooltip to hover for color presets HOT 2
- Data Views: Persistent layout option for templates (and others) in site editor
- Nav Block: Add Support for Separator Block & Borders
- Using the delete key inside the "Rename" modal deletes the current block HOT 2
- [DataViews] Reordering Items? HOT 5
- Patterns Explorer: Improve pagination layout when 'Show button text labels' preference is enabled HOT 1
- Add more collapsed navigation icon options HOT 4
- Scroll Bar present in styles colors preset panel HOT 5
- Global styles panel header buttons text overlaps when 'Show button text labels' is enabled HOT 4
- Improve implementation of the 'Show button text labels' preference HOT 13
- Interactivity: Warn texts should be eliminated from production builds HOT 1
- Aspect ratio preset names are not translatable
- ``render_block_data`` hook maybe conflicting with global styles HOT 5
- New Block: Generic Date/Time Block HOT 2
- Gutenberg Tabs crashing on Edit with React error - unable to edit tabs or content 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 gutenberg.