From 1751bfea5f49c53c37558e512a83fb03a3231a48 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 13 Nov 2022 11:23:14 +0900 Subject: [PATCH] update node to v18 --- .node-version | 2 +- CHANGELOG.md | 1 + Dockerfile | 4 ++-- packages/backend/src/core/RelayService.ts | 4 +--- packages/backend/src/core/entities/DriveFileEntityService.ts | 4 +--- packages/backend/src/server/web/ClientServerService.ts | 4 +--- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.node-version b/.node-version index 7fd023741..e44a38e08 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v16.15.0 +v18.12.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e47077d..f1bc0a96f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ You should also include the user name that made the change. ## 12.x.x (unreleased) ### Changes +- Node.js 18.x or later is required - Elasticsearchのサポートが削除されました - 代わりに今後任意の検索プロバイダを設定できる仕組みを構想しています。その仕組みを使えば今まで通りElasticsearchも利用できます - ノートのウォッチ機能が削除されました diff --git a/Dockerfile b/Dockerfile index 81dc72637..0151797a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.15.1-bullseye AS builder +FROM node:18.12.1-bullseye AS builder ARG NODE_ENV=production @@ -13,7 +13,7 @@ RUN yarn install RUN yarn build RUN rm -rf .git -FROM node:16.15.1-bullseye-slim AS runner +FROM node:18.12.1-bullseye-slim AS runner WORKDIR /misskey diff --git a/packages/backend/src/core/RelayService.ts b/packages/backend/src/core/RelayService.ts index 5324826ec..563eeac0f 100644 --- a/packages/backend/src/core/RelayService.ts +++ b/packages/backend/src/core/RelayService.ts @@ -105,9 +105,7 @@ export class RelayService { })); if (relays.length === 0) return; - // TODO - //const copy = structuredClone(activity); - const copy = JSON.parse(JSON.stringify(activity)); + const copy = structuredClone(activity); if (!copy.to) copy.to = ['https://www.w3.org/ns/activitystreams#Public']; const signed = await this.apRendererService.attachLdSignature(copy, user); diff --git a/packages/backend/src/core/entities/DriveFileEntityService.ts b/packages/backend/src/core/entities/DriveFileEntityService.ts index f0ac6518d..d9430e149 100644 --- a/packages/backend/src/core/entities/DriveFileEntityService.ts +++ b/packages/backend/src/core/entities/DriveFileEntityService.ts @@ -55,9 +55,7 @@ export class DriveFileEntityService { public getPublicProperties(file: DriveFile): DriveFile['properties'] { if (file.properties.orientation != null) { - // TODO - //const properties = structuredClone(file.properties); - const properties = JSON.parse(JSON.stringify(file.properties)); + const properties = structuredClone(file.properties); if (file.properties.orientation >= 5) { [properties.width, properties.height] = [properties.height, properties.width]; } diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 30d430775..44450245a 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -86,9 +86,7 @@ export class ClientServerService { } private async manifestHandler(ctx: Koa.Context) { - // TODO - //const res = structuredClone(manifest); - const res = JSON.parse(JSON.stringify(manifest)); + const res = structuredClone(manifest); const instance = await this.metaService.fetch(true);