Skip to content

Commit

Permalink
Merge branch 'trunk' into add/boost/e2e-page-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
dilirity committed Apr 2, 2024
2 parents 7decab3 + 978b29f commit 97278b6
Show file tree
Hide file tree
Showing 193 changed files with 1,712 additions and 836 deletions.
3 changes: 3 additions & 0 deletions .github/files/phpcompatibility-dev-phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
<rule ref="PHPCompatibilityWP">
<!-- Doesn't hurt anything, earlier versions ignore attributes. -->
<exclude name="PHPCompatibility.Attributes.NewAttributes.Found" />

<!-- We're not ready for 8.4 yet. Hopefully https://core.trac.wordpress.org/ticket/58719 will happen before we are. -->
<exclude name="PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated" />
</rule>
</ruleset>
3 changes: 3 additions & 0 deletions .github/files/renovate-post-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -eo pipefail

# Signal to jetpack CLI that we're part of a CI run, so it doesn't try to prompt for tracking.
export CI=1

BASE="$PWD"
BRANCH="$1"
CHANGEFILE="$(sed 's/[<>:"/\\|?*]/-/g' <<<"$BRANCH")"
Expand Down
3 changes: 3 additions & 0 deletions .github/renovate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ module.exports = {
constraints: {
php: `~${ versions.MIN_PHP_VERSION }.0`,
},
// Need to have renovate tell composer to ignore `.require.php` since dev deps aren't constrained by this
// but renovate insists on using the above to choose the PHP version to run with. Sigh.
composerIgnorePlatformReqs: [ 'ext-*', 'lib-*', 'php' ],
},
...( () => {
const ret = {};
Expand Down
1 change: 1 addition & 0 deletions .phan/config.base.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function make_phan_config( $dir, $options = array() ) {
"$root/vendor/php-stubs/wp-cli-stubs/wp-cli-commands-stubs.php",
"$root/vendor/php-stubs/wp-cli-stubs/wp-cli-i18n-stubs.php",
"$root/.phan/stubs/wordpress-constants.php",
"$root/.phan/stubs/wpcom-functions.php",
) : array(),
$options['file_list'],
$options['parse_file_list']
Expand Down
21 changes: 21 additions & 0 deletions .phan/stubs/wpcom-functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Phan stubs for WPCOM-defined functions.
*
* @package automattic/jetpack-monorepo
*/

/**
* Whether to enable the nav redesign.
*
* @phan-return bool Returns true if the nav redesign is enabled, false otherwise.
*/
function wpcom_is_nav_redesign_enabled(): bool {}

/**
* Whether the user is an Automattician
*
* @param int|null $user_id The user id.
* @phan-return bool Returns true if the user is Automattician, false otherwise.
*/
function is_automattician( $user_id = null ): bool {} // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
30 changes: 13 additions & 17 deletions pnpm-lock.yaml

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

10 changes: 10 additions & 0 deletions projects/js-packages/ai-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.0] - 2024-04-01
### Added
- AI Client: include prompt to generate featured image based on post content. [#36591]
- Support different responses in image hook [#36626]

### Fixed
- AI Client: fix a bug where quick prompts would not work after getting suggested content [#36651]
- AI Client: set request content type as JSON on image generation hook and use rectangular images instead of square images. [#36620]

## [0.10.1] - 2024-03-27
### Changed
- Updated package dependencies. [#36539, #36585]
Expand Down Expand Up @@ -263,6 +272,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies. [#31659]
- Updated package dependencies. [#31785]

[0.11.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.10.1...v0.11.0
[0.10.1]: https://github.com/Automattic/jetpack-ai-client/compare/v0.10.0...v0.10.1
[0.10.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.8.2...v0.9.0
Expand Down

This file was deleted.

This file was deleted.

5 changes: 3 additions & 2 deletions projects/js-packages/ai-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@automattic/jetpack-ai-client",
"version": "0.10.2-alpha",
"version": "0.11.0",
"description": "A JS client for consuming Jetpack AI services",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/ai-client/#readme",
"bugs": {
Expand All @@ -18,7 +18,8 @@
"build": "pnpm run clean && pnpm run compile-ts",
"clean": "rm -rf build/",
"compile-ts": "tsc --pretty",
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"watch": "tsc --watch --pretty"
},
"type": "module",
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useImperativeHandle, useRef, useEffect, useCallback } from '@wordpress/
import { __ } from '@wordpress/i18n';
import { Icon, closeSmall, check, arrowUp, trash, reusableBlock } from '@wordpress/icons';
import classNames from 'classnames';
import { forwardRef } from 'react';
import React from 'react';
import debugFactory from 'debug';
import React, { forwardRef } from 'react';
/**
* Internal dependencies
*/
Expand Down Expand Up @@ -45,6 +45,8 @@ type AiControlProps = {
// eslint-disable-next-line @typescript-eslint/no-empty-function
const noop = () => {};

const debug = debugFactory( 'jetpack-ai-client:ai-control' );

/**
* AI Control component.
*
Expand Down Expand Up @@ -84,11 +86,7 @@ export function AIControl(
if ( editRequest ) {
promptUserInputRef?.current?.focus();
}

if ( ! editRequest && lastValue !== null && value !== lastValue ) {
onChange?.( lastValue );
}
}, [ editRequest, lastValue, value ] );
}, [ editRequest ] );

const sendRequest = useCallback( () => {
setLastValue( value );
Expand Down Expand Up @@ -119,6 +117,7 @@ export function AIControl(
}, [] );

const cancelEdit = useCallback( () => {
debug( 'cancelEdit, revert to last value', lastValue );
onChange( lastValue || '' );
setEditRequest( false );
}, [ lastValue ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ const useImageGenerator = () => {
const generateImage = async function ( {
feature,
postContent,
responseFormat = 'url',
}: {
feature: string;
postContent: string;
} ): Promise< { data: Array< { url: string } > } > {
responseFormat?: 'url' | 'b64_json';
} ): Promise< { data: Array< { [ key: string ]: string } > } > {
let token = '';

try {
Expand Down Expand Up @@ -49,7 +51,7 @@ This is the post content:

const body = {
prompt: imageGenerationPrompt,
response_format: 'url',
response_format: responseFormat,
feature,
size: '1792x1024',
};
Expand All @@ -65,7 +67,7 @@ This is the post content:
body: JSON.stringify( body ),
} ).then( response => response.json() );

return data as { data: { url: string }[] };
return data as { data: { [ key: string ]: string }[] };
} catch ( error ) {
return;
}
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## [0.50.5] - 2024-03-29
### Changed
- Internal updates.

## [0.50.4] - 2024-03-27
### Changed
- Updated package dependencies. [#36539, #36585]
Expand Down Expand Up @@ -991,6 +995,7 @@
### Changed
- Update node version requirement to 14.16.1

[0.50.5]: https://github.com/Automattic/jetpack-components/compare/0.50.4...0.50.5
[0.50.4]: https://github.com/Automattic/jetpack-components/compare/0.50.3...0.50.4
[0.50.3]: https://github.com/Automattic/jetpack-components/compare/0.50.2...0.50.3
[0.50.2]: https://github.com/Automattic/jetpack-components/compare/0.50.1...0.50.2
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
"version": "0.50.5-alpha",
"version": "0.50.5",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/image-guide/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.8] - 2024-03-29
### Changed
- Updated package dependencies. [#30684]

## [0.5.7] - 2024-03-15
### Changed
- Updated package dependencies. [#36142]
Expand Down Expand Up @@ -100,6 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- Minor package.json change - removing private entry.

[0.5.8]: https://github.com/Automattic/jetpack-image-guide/compare/v0.5.7...v0.5.8
[0.5.7]: https://github.com/Automattic/jetpack-image-guide/compare/v0.5.6...v0.5.7
[0.5.6]: https://github.com/Automattic/jetpack-image-guide/compare/v0.5.5...v0.5.6
[0.5.5]: https://github.com/Automattic/jetpack-image-guide/compare/v0.5.4...v0.5.5
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/image-guide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-image-guide",
"version": "0.5.8-alpha",
"version": "0.5.8",
"description": "Go through the dom to analyze image size on screen vs actual file size.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/image-guide/#readme",
"type": "module",
Expand Down
5 changes: 5 additions & 0 deletions projects/packages/backup/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.5] - 2024-04-01
### Changed
- Update dependencies. [#36655]

## [3.3.4] - 2024-03-27
### Changed
- Updated package dependencies. [#36585]
Expand Down Expand Up @@ -593,6 +597,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add API endpoints and Jetpack Backup package for managing Help…

[3.3.5]: https://github.com/Automattic/jetpack-backup/compare/v3.3.4...v3.3.5
[3.3.4]: https://github.com/Automattic/jetpack-backup/compare/v3.3.3...v3.3.4
[3.3.3]: https://github.com/Automattic/jetpack-backup/compare/v3.3.2...v3.3.3
[3.3.2]: https://github.com/Automattic/jetpack-backup/compare/v3.3.1...v3.3.2
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/backup/src/class-package-version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '3.3.4';
const PACKAGE_VERSION = '3.3.5';

const PACKAGE_SLUG = 'backup';

Expand Down
2 changes: 1 addition & 1 deletion projects/packages/blaze/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
return [
// # Issue statistics:
// PhanUndeclaredTypeParameter : 25+ occurrences
// PhanUndeclaredFunction : 8 occurrences
// PhanUndeclaredClassMethod : 7 occurrences
// PhanUndeclaredFunction : 7 occurrences
// PhanTypeArraySuspicious : 5 occurrences
// PhanUndeclaredClassProperty : 4 occurrences
// PhanTypeMismatchArgument : 3 occurrences
Expand Down
5 changes: 5 additions & 0 deletions projects/packages/blaze/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.20.1] - 2024-04-01
### Added
- Change Phan baselines. [#36627]

## [0.20.0] - 2024-03-27
### Added
- Adds the atomic flag to the Jetpack Blaze base site's configuration [#36562]
Expand Down Expand Up @@ -334,6 +338,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated package dependencies. [#27906]

[0.20.1]: https://github.com/automattic/jetpack-blaze/compare/v0.20.0...v0.20.1
[0.20.0]: https://github.com/automattic/jetpack-blaze/compare/v0.19.3...v0.20.0
[0.19.3]: https://github.com/automattic/jetpack-blaze/compare/v0.19.2...v0.19.3
[0.19.2]: https://github.com/automattic/jetpack-blaze/compare/v0.19.1...v0.19.2
Expand Down
Loading

0 comments on commit 97278b6

Please sign in to comment.