-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: cleanup constants and refactor autoload handling #278
Conversation
|
@justlevine on quick scan I see the new AutoLoader.php but I don't see a change that invokes the class in in the main plugin? |
fml i didnt push everything 1 sec
|
b2516bf
to
1d4fdc9
Compare
Amazing that I caught you with a case of my famous "Moving too fasts". Usually it's me and not you that's suffering from this! 😆 |
@jasonbahl force-pushed with all the files this time i promise 🤣 |
bin/versionPlugin.js
Outdated
@@ -68,7 +68,7 @@ async function bumpStableTag(readmeTxt, version) { | |||
async function bumpVersionConstant(pluginFile, version) { | |||
return bumpVersion( | |||
pluginFile, | |||
/^\s*\$this->define\(\s*'WPGRAPHQL_CONTENT_BLOCKS_VERSION', '([0-9.]+)/gm, | |||
/^\s*define\(\s*'WPGRAPHQL_CONTENT_BLOCKS_VERSION', '([0-9.]+)/gm, |
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.
while we're making changes to the versionPlugin.js. . .we might be able to satisfy the replacing of @since @todo
references as well 🤔
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.
Not required to approve this PR, just a thought though. If we standardize on @since @todo
or @since @next
or something like that, then we could automate the update with the rest of the changesets version updates 🤔
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.
regular @todo
like used in the _doing_it_wrong( '...', '@todo' )
functions might be a bit broad. . .although we could regex replace that like we do the WPGRAPHQL_CONTENT_BLOCKS_VERSION
above? 🤔
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.
That's outta my wheelhouse, I had to triple check this "simple" change 🙃
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.
haha! all good. I can follow-up on that separately. . .would just need to make a standard of how we add the placeholders.
like is it always:
_doing_it_wrong( 'some string', '@todo' );
and
/**
* Some docblock
* @since @todo
*/
etc?
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.
I mean that's how I do it, but really out of a general habit of checking all @todo
s before pushing a release.
To make it easier to regex regardless of if its _doing_it_wrong()
, _deprecated_*()
, @since
or even a regular doc-block reference, maybe we intentionally want to use/reserve @next
or @next-version
? then we can just match the annotation instead of the wrapper
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.
ya, was thinking @next-version
as well
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.
that way @todo
can be left for other uses of @todo
that IDEs already have tooling to pick up, etc 🤔
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.
So long as it doesnt make phpcs complain
1d4fdc9
to
248f68e
Compare
248f68e
to
766737d
Compare
This was squashed in #279 |
What
This PR fixes the plugin's naive autoload detection which previously would:
admin_notice
)admin_notice
if the plugin was installed as a composer dependency itself (even though the plugin dependencies would get installed).How
\WPGraphQL\ContentBlocks\Autoloader
, where it checks (in order):a. if
WPGRAPHQL_CONTENT_BLOCKS_AUTOLOAD
wants us to skip autoloadingb. if we've previously loaded the dependencies (via a static property)
c. if the
WPGraphQLContentBlocks
class exists (that means it's being autoloaded already)d. and only then if there is a local
vendor/autoload.php
file.wp-graphql-content-blocks.php::wpgraphql_content_blocks_init()
, where it isrequired_once
ed instead of the (now autoloaded)WPGraphQLContentBlocks
class.WPGraphQLContentBlocks
have been moved to the pluggablewp-graphql-content-blocks.php:wpgraphql_content_blocks_constants()
, (The versioning script was updated to accomodate the change)WPGRAPHQL_CONTENT_BLOCKS_FILE
=>WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_FILE
WPGRAPHQL_CONTENT_BLOCKS_PATH
=>WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_PATH
WPGRAPHQL_CONTENT_BLOCKS_MIN_PHP_VERSION
=> no replacement (this seems to be an artifact from wp-graphql core boilerplate).To test
composer.json
repositories:Additional notes
@todo
tags are used for version numbers and should be replaced once we know what the version will be.