Skip to content

Commit 1405a09

Browse files
authored
Adding D11 support for nextjs. (#778)
1 parent c06b861 commit 1405a09

25 files changed

+87
-91
lines changed

.github/workflows/next.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
phpunit:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
strategy:
1414
matrix:
1515
# Supported PHP versions: https://www.drupal.org/docs/getting-started/system-requirements/php-requirements
@@ -22,15 +22,21 @@ jobs:
2222
- "10.0.x"
2323
- "10.1.x"
2424
- "10.2.x"
25+
- "10.3.x"
26+
- "11.0.x"
2527
exclude:
2628
- drupal: "10.0.x"
2729
php: "8.3"
2830
- drupal: "10.1.x"
2931
php: "8.3"
32+
- drupal: "11.0.x"
33+
php: "8.1"
34+
- drupal: "11.0.x"
35+
php: "8.2"
3036
name: Drupal ${{ matrix.drupal }} - PHP ${{ matrix.php }}
3137
services:
3238
mysql:
33-
image: mysql:5.7
39+
image: mysql:8.0
3440
env:
3541
MYSQL_ALLOW_EMPTY_PASSWORD: yes
3642
MYSQL_DATABASE: db

modules/next/.gitlab-ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ include:
5252
#
5353
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
5454
################
55-
# variables:
56-
# SKIP_ESLINT: '1'
57-
55+
variables:
56+
# SKIP_ESLINT: '1'
57+
OPT_IN_TEST_PREVIOUS_MINOR: 1
58+
OPT_IN_TEST_NEXT_MINOR: 1
59+
OPT_IN_TEST_NEXT_MAJOR: 1
5860
###################################################################################
5961
#
6062
# *

modules/next/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"drupal/subrequests": "^3.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0"
20+
"phpunit/phpunit": "^9 || ^10"
2121
}
2222
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Next.js Extras (Experimental)
22
description: Adds extra (mostly experiemental) functionality to Next.js module
33
type: module
4-
core_version_requirement: ^9 || ^10
4+
core_version_requirement: ^10 || ^11
55
package: Web services
66
dependencies:
77
- next:next

modules/next/modules/next_extras/src/NextCacheInvalidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public function invalidatePath(string $path, array $sites): void {
143143
}
144144
}
145145
catch (RequestException $exception) {
146-
watchdog_exception('next_extras', $exception);
146+
// Using logger service to log the exception.
147+
$this->logger->error($exception->getMessage());
147148
}
148149
}
149150
}

modules/next/modules/next_graphql/next_graphql.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 'Next.js GraphQL'
22
type: module
33
description: 'GraphQL for Next.js'
4-
core_version_requirement: ^9 || ^10
4+
core_version_requirement: ^10 || ^11
55
package: Web services
66
dependencies:
77
- graphql:graphql

modules/next/modules/next_jsonapi/next_jsonapi.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 'Next.js JSON:API'
22
type: module
33
description: 'JSON:API Helpers for Next.js'
4-
core_version_requirement: ^9 || ^10
4+
core_version_requirement: ^10 || ^11
55
package: Web services
66
dependencies:
77
- decoupled_router:decoupled_router

modules/next/modules/next_jsonapi/src/NextJsonapiServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class NextJsonapiServiceProvider extends ServiceProviderBase {
1515
*/
1616
public function alter(ContainerBuilder $container) {
1717
/** @var \Symfony\Component\DependencyInjection\Definition $definition */
18-
1918
if ($container->hasDefinition('jsonapi.entity_resource')) {
2019
$definition = $container->getDefinition('jsonapi.entity_resource');
2120
$definition->setClass('Drupal\next_jsonapi\Controller\EntityResource');

modules/next/modules/next_jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Drupal\Tests\node\Traits\NodeCreationTrait;
99
use Drupal\Tests\user\Traits\UserCreationTrait;
1010
use Drupal\user\Entity\User;
11-
use Symfony\Component\HttpFoundation\ParameterBag;
11+
use Symfony\Component\HttpFoundation\InputBag;
1212
use Symfony\Component\HttpFoundation\Request;
1313

1414
/**
@@ -91,14 +91,14 @@ public function testPageLimit() {
9191

9292
// Default using \Drupal\jsonapi\Query\OffsetPage::SIZE_MAX.
9393
$request = Request::create('/jsonapi/node/article');
94-
$request->query = new ParameterBag();
94+
$request->query = new InputBag();
9595
$response = $entity_resource->getCollection($resource_type, $request);
9696
$data = $response->getResponseData()->getData();
9797
$this->assertSame(50, $data->count());
9898

9999
// With page limit.
100100
$request = Request::create('/jsonapi/node/article');
101-
$request->query = new ParameterBag([
101+
$request->query = new InputBag([
102102
'page' => [
103103
'limit' => 10,
104104
],
@@ -109,7 +109,7 @@ public function testPageLimit() {
109109

110110
// With page limit over size max.
111111
$request = Request::create('/jsonapi/node/article');
112-
$request->query = new ParameterBag([
112+
$request->query = new InputBag([
113113
'page' => [
114114
'limit' => 100,
115115
],
@@ -120,7 +120,7 @@ public function testPageLimit() {
120120

121121
// With page limit and offset.
122122
$request = Request::create('/jsonapi/node/article');
123-
$request->query = new ParameterBag([
123+
$request->query = new InputBag([
124124
'page' => [
125125
'offset' => 2,
126126
'limit' => 5,
@@ -132,7 +132,7 @@ public function testPageLimit() {
132132

133133
// With fields as sparse fieldset.
134134
$request = Request::create('/jsonapi/node/article');
135-
$request->query = new ParameterBag([
135+
$request->query = new InputBag([
136136
'fields' => [
137137
'node--article' => 'title',
138138
],
@@ -143,7 +143,7 @@ public function testPageLimit() {
143143

144144
// Using sparse fieldset path override.
145145
$request = Request::create('/jsonapi/node/article');
146-
$request->query = new ParameterBag([
146+
$request->query = new InputBag([
147147
'fields' => [
148148
'node--article' => 'path,title',
149149
],
@@ -154,7 +154,7 @@ public function testPageLimit() {
154154

155155
// Using sparse fieldset path override and limit.
156156
$request = Request::create('/jsonapi/node/article');
157-
$request->query = new ParameterBag([
157+
$request->query = new InputBag([
158158
'fields' => [
159159
'node--article' => 'path,title',
160160
],
@@ -168,7 +168,7 @@ public function testPageLimit() {
168168

169169
// Using sparse fieldset path override and limit.
170170
$request = Request::create('/jsonapi/node/article');
171-
$request->query = new ParameterBag([
171+
$request->query = new InputBag([
172172
'fields' => [
173173
'node--article' => 'path,title',
174174
],

modules/next/modules/next_jwt/next_jwt.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Next.js JWT (Experimental)
22
type: module
33
description: 'Generates preview URLs using JSON Web Token'
4-
core_version_requirement: ^9 || ^10
4+
core_version_requirement: ^10 || ^11
55
package: Web services
66
dependencies:
77
- next:next

0 commit comments

Comments
 (0)