Skip to content
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

Transfer Verbum app into into jetpack-mu-wpcom #34993

Merged
merged 56 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
40dc407
Add Verbum Comments in Jetpack-mu-wpcom
agrullon95 Jan 11, 2024
67760a1
changelog
agrullon95 Jan 11, 2024
88a257d
Add dynamic import support to webpack config
agrullon95 Jan 13, 2024
39570ea
Add logi to load new Jetpack Verbum Comment class if its not already …
agrullon95 Jan 13, 2024
b88da1c
Add Verbum Comments project into jetpack-mu-wpcom features directory
agrullon95 Jan 13, 2024
b9bbdf3
Remove Verbum editor folder since it will be loaded from new package
agrullon95 Jan 13, 2024
0e1f43e
Add plugin to replace verbumBundleSize global variable value
agrullon95 Jan 17, 2024
43a797f
Use GetVerbumBundleSizePlugin in webpack config
agrullon95 Jan 17, 2024
d25ddb9
Update verbum comments code
agrullon95 Jan 17, 2024
69afbe1
Add custom loading spinner
agrullon95 Jan 17, 2024
4833d6e
remove extra testing custom spinner
agrullon95 Jan 17, 2024
2117c38
Update package.json to include required verbum dependencies
heavyweight Jan 17, 2024
be415c4
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
agrullon95 Jan 18, 2024
7a09ecc
update package.json
agrullon95 Jan 18, 2024
1295e09
Update webpack config
agrullon95 Jan 18, 2024
ca23f49
merge babel config
agrullon95 Jan 18, 2024
bcf2447
Ignore verbum-comments.js build in 18nCheckPlugin
agrullon95 Jan 18, 2024
a696fca
Move get-verbum-bundle-size-plugin location
agrullon95 Jan 18, 2024
d955ab6
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
agrullon95 Jan 18, 2024
5ac3a48
Remove i18CheckPlugin filter
agrullon95 Jan 18, 2024
2cc6f0e
Remove unnecssary files
agrullon95 Jan 18, 2024
460cc92
Hardcode verbumBundleSize to 30000
agrullon95 Jan 18, 2024
e31d9a1
Moving Verbum package.json dependencies to jetpack-mu-wpcom
agrullon95 Jan 18, 2024
78885b2
Hack around preact having `__` methods internally
anomiex Jan 18, 2024
63cf770
index.php lint changes
agrullon95 Jan 18, 2024
aa641ee
Update verbum php usage/import
agrullon95 Jan 18, 2024
f99c93c
Fix lint issues for gutenberg comments php
agrullon95 Jan 18, 2024
10f2507
update verbum ombed class
agrullon95 Jan 18, 2024
9dc3f0e
Update verbum auth class lint issues
agrullon95 Jan 18, 2024
ba2dd2e
Try something a little less hacky to hack preact
anomiex Jan 18, 2024
a11f3e9
Fix html_entity_decode lint issue
agrullon95 Jan 18, 2024
015c073
php lint fixes
agrullon95 Jan 19, 2024
6c66b5d
Fix lint issues part 1
renancarvalho Jan 19, 2024
e445ed7
Fix eslint event issue
renancarvalho Jan 19, 2024
9d197fd
Turn off `testing-library/prefer-screen-queries`
alshakero Jan 19, 2024
43a064d
Linting
alshakero Jan 19, 2024
692cad2
update util.ts lint
agrullon95 Jan 19, 2024
6d9dbe3
Add useSocialLogin hook JSDoc and update conditional useEffect
agrullon95 Jan 19, 2024
aab85be
Lint ToggleControl
alshakero Jan 19, 2024
6bb491c
Update handleBeforeUnload to use preact effect
agrullon95 Jan 19, 2024
05c883f
More linting
alshakero Jan 19, 2024
4fa8476
More linting
alshakero Jan 19, 2024
898f921
Fix handleBeforeUnload
alshakero Jan 19, 2024
4ce269a
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
alshakero Jan 19, 2024
7074f28
Bring over https://github.com/Automattic/verbum/pull/141
alshakero Jan 19, 2024
355ebdf
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
alshakero Jan 22, 2024
925423c
Update beforeunload logic
agrullon95 Jan 22, 2024
d9178e7
Move handleClose function order
agrullon95 Jan 22, 2024
557dbc7
Update event dispose logic
heavyweight Jan 22, 2024
c0aed72
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
heavyweight Jan 22, 2024
0af3b26
update package version
agrullon95 Jan 22, 2024
c64dc3c
Fix subscription closeModalHandlercommentUrl issue
agrullon95 Jan 23, 2024
70551b8
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
agrullon95 Jan 23, 2024
69dd842
Dont touch babel and webpack config for other projects
alshakero Jan 23, 2024
8f0e01f
Exclude P2 and forums from Verbum
alshakero Jan 23, 2024
f0eedd1
Merge branch 'trunk' into add/verbum-comment-into-jetpack-mu-wpcom
alshakero Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 34 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions projects/packages/jetpack-mu-wpcom/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": [
[
"@babel/plugin-transform-react-jsx",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converts JSX to react function calls.

Example
-> React.createElement("div", null, "Example");

{
"pragma": "h",
"pragmaFrag": "Fragment"
}
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Add Verbum Comments in jetpack-mu-wpcom plugin
7 changes: 6 additions & 1 deletion projects/packages/jetpack-mu-wpcom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom",
"version": "5.8.2-alpha",

Check failure on line 4 in projects/packages/jetpack-mu-wpcom/package.json

View workflow job for this annotation

GitHub Actions / Changelogger validity

Version mismatch, expected 5.9.0-alpha but found 5.8.2-alpha! You might use `tools/project-version.sh -f -u 5.9.0-alpha packages/jetpack-mu-wpcom` or `tools/fixup-project-versions.sh` to fix this.
"description": "Enhances your site with features powered by WordPress.com",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme",
"bugs": {
Expand All @@ -27,13 +27,18 @@
},
"devDependencies": {
"@automattic/jetpack-webpack-config": "workspace:*",
"sass": "1.64.1",
"sass-loader": "12.4.0",
"typescript": "^5.0.4",
"webpack": "5.76.0",
"webpack-cli": "4.9.1"
},
"dependencies": {
"@babel/core": "7.23.5",
"@babel/plugin-transform-react-jsx": "7.23.4",
"@sentry/browser": "7.80.1",
"@wordpress/api-fetch": "6.45.0",
"@wordpress/hooks": "3.48.0"
"@wordpress/hooks": "3.48.0",
"copy-webpack-plugin": "11.0.0"
}
}
10 changes: 10 additions & 0 deletions projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class Jetpack_Mu_Wpcom {

const PACKAGE_VERSION = '5.8.2-alpha';

Check failure on line 17 in projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php

View workflow job for this annotation

GitHub Actions / Changelogger validity

Version mismatch, expected 5.9.0-alpha but found 5.8.2-alpha! You might use `tools/project-version.sh -f -u 5.9.0-alpha packages/jetpack-mu-wpcom` or `tools/fixup-project-versions.sh` to fix this.
const PKG_DIR = __DIR__ . '/../';
const BASE_DIR = __DIR__ . '/';
const BASE_FILE = __FILE__;
Expand Down Expand Up @@ -43,6 +43,8 @@

add_action( 'plugins_loaded', array( __CLASS__, 'load_first_posts_stream_helpers' ) );

add_action( 'plugins_loaded', array( __CLASS__, 'load_verbum_comments' ) );

// Unified navigation fix for changes in WordPress 6.2.
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'unbind_focusout_on_wp_admin_bar_menu_toggle' ) );

Expand Down Expand Up @@ -211,4 +213,12 @@
public static function load_first_posts_stream_helpers() {
require_once __DIR__ . '/features/first-posts-stream/first-posts-stream-helpers.php';
}

/**
* Load Verbum Comments.
*/
public static function load_verbum_comments() {
require_once __DIR__ . '/build/verbum-comments/index.php';
new Verbum_Comments();
}
}
31 changes: 29 additions & 2 deletions projects/packages/jetpack-mu-wpcom/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const path = require( 'path' );
const jetpackConfig = require( '@automattic/jetpack-webpack-config/webpack' );
const CopyPlugin = require( 'copy-webpack-plugin' );
const webpack = require( 'webpack' );

module.exports = {
entry: {
'error-reporting': './src/features/error-reporting/index.js',
'verbum-comments': './src/features/verbum-comments/src/index.tsx',
},
mode: jetpackConfig.mode,
devtool: jetpackConfig.devtool,
Expand All @@ -19,7 +22,28 @@ module.exports = {
...jetpackConfig.resolve,
},
node: false,
plugins: [ ...jetpackConfig.StandardPlugins() ],
plugins: [
...jetpackConfig.StandardPlugins( {
DependencyExtractionPlugin: { injectPolyfill: true },
MiniCssExtractPlugin: { filename: '[name]/[name].css' },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outputs CSS in the same build directory as the entry.

For Verbum, css will output in build/verbum-comments.

} ),
new webpack.ProvidePlugin( {
h: [ 'preact', 'h' ],
Fragment: [ 'preact', 'Fragment' ],
} ),
new CopyPlugin( {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copies Verbum php files into build/verbum-comments folder.

patterns: [
{
from: './src/features/verbum-comments/index.php',
to: './verbum-comments',
},
{
from: './src/features/verbum-comments/assets',
to: './verbum-comments/assets',
},
],
} ),
],
module: {
strictExportPresence: true,
rules: [
Expand All @@ -34,7 +58,10 @@ module.exports = {
} ),

// Handle CSS.
jetpackConfig.CssRule(),
jetpackConfig.CssRule( {
extensions: [ 'css', 'sass', 'scss' ],
Copy link
Contributor Author

@agrullon95 agrullon95 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handles scss conversion to css

extraLoaders: [ 'sass-loader' ],
} ),

// Handle images.
jetpackConfig.FileRule(),
Expand Down
Loading