-
Notifications
You must be signed in to change notification settings - Fork 800
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
Contact Form: Removing code and renaming relevant references to ensure we use the package version #37157
Conversation
…package version will always be used
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
@@ -1,126 +0,0 @@ | |||
<?php |
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 the class or the file were not marked as deprecated before, I would recommend keeping that file around for a couple more releases, but mark them as deprecated so they throw a notice instead of a fatal for anyone that may still rely on them.
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.
Thanks for pointing that out. Added back and marking as deprecated now in ded8b13
* Prevent the registration of the blocks from extensions/blocks/contact-form | ||
* if the Forms package is enabled. | ||
*/ | ||
'is_form_package_enabled' => apply_filters( 'jetpack_contact_form_use_package', true ), |
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.
You should be able to add that deprecated hook to the deprecated_hooks
method in the Jetpack
class.
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.
Ah good to know.
@@ -35,24 +35,6 @@ | |||
return true; // Not returning true will cause the module to become deactivated. |
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.
Should we remove the check provided by the filter above now and deprecate the filter, since there is no other way to use the contact form anymore?
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 did wonder, especially with the comment after return true
. But everything works well in testing so this looks like it should be ok to deprecate. I'll add an update to the WPcom diff as well as there is one more filter mention there.
if ( is_admin() && apply_filters_deprecated( 'tmp_grunion_allow_editor_view', array( true ), '13.2.0', '', 'This functionality will be removed in an upcoming version.' ) ) { | ||
require_once __DIR__ . '/contact-form/grunion-editor-view.php'; | ||
} | ||
|
||
/** | ||
* Register Jetpack Form patterns |
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 think we should be able to remove this as well, since it is provided in the package too.
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.
Gotcha.
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.
Actually to double check, what code are you referring to removing?
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.
The code that registers the patterns, jetpack_form_register_pattern
. It's also in Utils::register_pattern()
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.
Ah right, I was busy searching for the function name instead. So since it lives elsewhere now with a different function name, presumably I'd still need to deprecate this specific function initially first before deleting it, similarly to the Google Drive Helper functions? I've assumed so initially with a new commit.
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.
Yes, I think that's the right thing to do! 👍
'modules/contact-form/css/editor-inline-editing-style', | ||
'modules/contact-form/css/editor-style', | ||
'modules/contact-form/css/editor-ui', | ||
'jetpack_vendor/automattic/jetpack-forms/src/contact-form/css/editor-inline-editing-style', |
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.
Couldn't we remove those altogether, since they are built in the package via the projects/packages/forms/tools/webpack.config.contact-form.js
config?
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.
Yes definitely :) I just realized the issue now on rebuilding locally, and spotting some untracked rtl CSS files being generated.
'_inc/build/contact-form/js/tinymce-plugin-form-button.min.js', | ||
'modules/contact-form/js/tinymce-plugin-form-button.js' | ||
'jetpack_vendor/automattic/jetpack-forms/src/contact-form/js/tinymce-plugin-form-button.js' |
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.
Could we load those 2 references relatively from the dist
dir instead?
https://github.com/Automattic/jetpack-forms/tree/1facd39f1b5d34ca8ed31b7f9d0fde2d8d94c540/dist/contact-form/js
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.
Certainly!
…es as this is handled in the package
…ition to prevent build failure
…on notice in a function, resulting in a check failure
Great catch, thanks. This will be fixed now in 387bd8f |
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.
LGTM!
…e we use the package version (#37157)
Fixes step 2 of this project: pf5801-Aj-p2
Proposed changes:
module/contact-form
files.Note - before merging, this diff needs to be deployed first: D147229-code
Other information:
Jetpack product discussion
pf5801-Aj-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions: