Opened 6 years ago
Closed 5 years ago
#8048 closed enhancement (fixed)
BuddyPress Blocks !
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | needs-patch |
Cc: | mercime.one@… |
Description
I think a good way to have some "real use cases" for the REST API is to use it into a new feature. And I think BuddyPress blocks are an easy and quick way to do so. Here's some early screenshots of what I've tried so far :
A new Blocks Category: BuddyPress
We could ship 2 or 3 dynamic blocks to test the REST API. I already built a static version of the Groups block, see the screencap below:
BuddyPress blocks could be developed into its own repository on GitHub and be added to core during a specific build step.
PS: @espellcaste This is what I've used to find the issues I've posted on the BP Rest repository.
Attachments (2)
Change History (27)
This ticket was mentioned in Slack in #buddypress by boone. View the logs.
6 years ago
#3
@
6 years ago
- Keywords needs-patch added
- Milestone changed from 5.0.0 to Up Next
@imath Let's move this to the next release. This will give us more time to analyze and decide which blocks to introduce and how/when.
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
5 years ago
#5
@
5 years ago
- Keywords needs-design added
I am really excited about this and happy to work on some sketches if that works for the next release? I really like the idea of it being a separate repo, adding in each as it's baked and ready to be shipped, allowing it to be tested in the meantime. If I can help at all please let me know as I have some ideas on how we can translate into blocks visually.
#6
@
5 years ago
- Milestone changed from Up Next to 6.0.0
Move the first tickets to next major release.
#7
@
5 years ago
- Keywords dev-feedback removed
As discussed during October 30 dev-chat, Blocks will be developed from https://github.com/buddypress/bp-blocks and merged "JavaScript built" as soon as they're ready.
Priority for 6.0.0 is to build a block to highlight a single Group. Of course everyone can contribute to other Blocks pulling requests in the GH repo.
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
5 years ago
#9
@
5 years ago
@imath Am I correct we will have two blocks for this release? Based on code merged on https://github.com/buddypress/bp-blocks
#10
@
5 years ago
- Keywords needs-design removed
Yes you are. I'll use this ticket to work on using WP CLI to generate our pot file. This is needed to make sure JS translation will be available for the blocks.
#11
@
5 years ago
- Keywords has-patch added; needs-patch removed
8048.patch is containing:
- the BP Blocks code to merge into Core
- it replaces
grunt-wp-i18n
by WP CLI i18n command (to ensure JavaScript translations) - it adds devDependencies for
parcel-bundler
,@babel/core
and@wordpress/babel-preset-default
- it adapts the build process for BP Blocks
- it adds a
src/js
directory containing the development versions of the blocks.
npm start
is like a grunt watch for these Block JavaScript files
npm run build
is used to build the Block JavaScripts into 2 Grunt tasks. During the build process, the first one is done without minifying scripts to make sure Translations are generated by WP CLI, the second one is used after this translation step and minifies the scripts.
Unlike what I thought in the first place, I believe it's best to merge the BP Blocks into Core completely (Thanks @johnjamesjacoby for making me thought about it twice !).
I chose to add un-minified built Block JavaScript files into /src
so that people starting to contribute to BuddyPress has no other steps to accomplish than checking out Trunk.
About the PHP part, I've added a specific BP_Block class and some other specific functions.
Feedbacks welcome ;)
#12
@
5 years ago
.2.patch is improving the previous patch making available the BP AutoCompleter component to BP Blocks developers. They just need to add a dependency to bp-block-components
when registering the JavaScript file of their block to be able to use it like this:
const { AutoCompleter } = bp.blockComponents; <AutoCompleter component="members" ariaLabel={ __( 'Member\'s username', 'buddypress' ) } placeholder={ __( 'Enter Member\'s username here…', 'buddypress' ) } onSelectItem={ setAttributes } useAvatar={ isAvatarEnabled } />
.2.patch is also moving Block Registration into BP Component
classes.
#22
@
5 years ago
- Keywords needs-patch added; has-patch removed
I've left the ticket open as the BP_TRAVISCI=travis:grunt
is failing due to a missing config file according to this error:
Error: Could not find "stylelint-scss". Do you need a `configBasedir`?
The fact we are using an old version of stylelint-config-wordpress
that doesn't seem to support node 10.13.0 might be the reason (see 11.0.0 in Changelog)
I'll look at it asap.
Really interesting!
Here's what I think:
@bonne might have something to add about adding blocks and @djPaul was really interested in it. So I think we should get their feedback and see what other plans they have in mind.