-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bucket - Editor #2415
base: master
Are you sure you want to change the base?
Bucket - Editor #2415
Conversation
Add a drop-in replacement for the `tribe_assets` function that will load assets from the `/build` directory.
Since assets are immediately registered in WordPress on registration, the URL will be set to the registration one. To avoid unregistering and re-registering the asset with the correct (/build) URL, just provide the `group_path` argument during registration.
…o bucket/packager
This updates the `data` attribute to use a less generic name and modifies the `click` handler logic to target IAN elements only. Additionally, ensure elements exist in the current context before targeting them.
…o bucket/packager
…o bucket/packager
Add a drop-in replacement for the `tribe_assets` function that will load assets from the `/build` directory.
Since assets are immediately registered in WordPress on registration, the URL will be set to the registration one. To avoid unregistering and re-registering the asset with the correct (/build) URL, just provide the `group_path` argument during registration.
This function is a shorthand for the application of the `tec_using_new_editor` filter.
// Vendor files should be loaded from `/vendor` directly, they are not built. | ||
if ( ! str_starts_with( $file, 'vendor' ) && ! isset( $arguments['group_path'] ) ) { | ||
// Build the group name from the plugin class name. | ||
$build_group_name = is_object( $origin ) ? get_class( $origin ) : (string) $origin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.Formatting.MultipleStatementAlignment.NotSameWarning
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
* | ||
* @since TBD | ||
* | ||
* @param object $origin The main Object for the plugin you are enqueueing the script/style for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @since TBD | ||
* | ||
* @param object $origin The main Object for the plugin you are enqueueing the script/style for. | ||
* @param array $assets { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @since TBD | ||
* | ||
* @param object $origin The main Object for the plugin you are enqueueing the script/style for. | ||
* @param array $assets { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Commenting.FunctionComment.ParamCommentFullStop
Parameter comment must end with a full stop
* Indexed array, don't use any associative key. | ||
* E.g.: [ 'slug-my-script', 'my/own/path.js', [ 'jquery' ] ] | ||
* | ||
* @type string $slug Slug to save the asset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @type string $file Which file will be loaded, either CSS or JS. | ||
* @type array $deps (optional) Dependencies | ||
* } | ||
* @param string $action A WordPress hook that will automatically enqueue this asset once fired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @type array $deps (optional) Dependencies | ||
* } | ||
* @param string $action A WordPress hook that will automatically enqueue this asset once fired. | ||
* @param array $arguments Look at `Tribe__Assets::register()` for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | ||
* @return array<Asset|bool> Which Assets were registered. | ||
*/ | ||
function tec_assets($origin, $assets, $action = null, $arguments = []){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen
Expected 1 spaces after opening parenthesis; 0 found
* | ||
* @return array<Asset|bool> Which Assets were registered. | ||
*/ | ||
function tec_assets($origin, $assets, $action = null, $arguments = []){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose
Expected 1 spaces before closing parenthesis; 0 found
* | ||
* @return array<Asset|bool> Which Assets were registered. | ||
*/ | ||
function tec_assets($origin, $assets, $action = null, $arguments = []){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.Functions.OpeningFunctionBraceKernighanRitchie.SpaceBeforeBrace
Expected 1 space before opening brace; found 0
@@ -774,7 +774,10 @@ public function bind_implementations() { | |||
tribe_singleton( 'admin.activation.page', 'Tribe__Admin__Activation_Page' ); | |||
tribe_singleton( Translations_Loader::class, Translations_Loader::class ); | |||
|
|||
tribe_register_provider( Tribe__Editor__Provider::class ); | |||
if ( !tec_using_classy_editor() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶StellarWP.Whitespace.LogicalNotSpacing.invalidWhitespace
! must be followed by a single space
@@ -774,7 +774,10 @@ | |||
tribe_singleton( 'admin.activation.page', 'Tribe__Admin__Activation_Page' ); | |||
tribe_singleton( Translations_Loader::class, Translations_Loader::class ); | |||
|
|||
tribe_register_provider( Tribe__Editor__Provider::class ); | |||
if ( !tec_using_classy_editor() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter
Expected 1 space after "!"; 0 found
@@ -18,3 +18,18 @@ function tec_is_full_site_editor() { | |||
return false; | |||
} | |||
} | |||
|
|||
if ( ! function_exists( 'tec_using_classy_editor' ) ) { | |||
function tec_using_classy_editor(): bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function tec_using_classy_editor()
Replace the WebPack configuration file with one set up by stellarwp/tyson. Together with it, remove the dependency on `product-taskmaster` including the babel configuration file.
Update the image paths from relative to the plugin root to relative to the postcss file being processed.
Explicitly require and include in the PostCSS pre-processing the `postcss-nested` and `postcss-custom-media` packages to make sure existing PostCSS code is processed the correct way, before `autoprefixer` kicks in.
Update the code to fix _most_ issues regarding asset registration and loading from the `/build` directory. Update the WebPack configuration file to include all required modules to build.
Updates to use tyson
No description provided.