1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-04 21:15:45 +02:00

perf(backend): jsdom、happy-domをやめて軽量な実装にし、メモリ削減・高速化 (#16885)

* wip

* Update packages/backend/src/server/api/endpoints/i/update.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/FetchInstanceMetadataService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove some packages

* コミット漏れ

* clean up

* fix

* Update MfmService.ts

* fix

* fix

* Update MfmService.ts

* wip

* rename

* Update packages/backend/src/core/MfmService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/MfmService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/MfmService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/MfmService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/activitypub/ApRendererService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/MfmService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/backend/src/core/MfmService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update MfmService.ts

* Update CHANGELOG.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
syuilo
2025-11-29 19:16:05 +09:00
committed by GitHub
parent 17a4d4fad9
commit 2732034447
14 changed files with 188 additions and 270 deletions

View File

@@ -6,7 +6,7 @@
import dns from 'node:dns/promises';
import { fileURLToPath } from 'node:url';
import { Inject, Injectable } from '@nestjs/common';
import { JSDOM } from 'jsdom';
import * as htmlParser from 'node-html-parser';
import httpLinkHeader from 'http-link-header';
import ipaddr from 'ipaddr.js';
import oauth2orize, { type OAuth2, AuthorizationError, ValidateFunctionArity2, OAuth2Req, MiddlewareRequest } from 'oauth2orize';
@@ -120,9 +120,9 @@ async function discoverClientInformation(logger: Logger, httpRequestService: Htt
}
const text = await res.text();
const fragment = JSDOM.fragment(text);
const fragment = htmlParser.parse(text);
redirectUris.push(...[...fragment.querySelectorAll<HTMLLinkElement>('link[rel=redirect_uri][href]')].map(el => el.href));
redirectUris.push(...[...fragment.querySelectorAll('link[rel=redirect_uri][href]')].map(el => el.attributes.href));
let name = id;
let logo: string | null = null;