Lazy loading of the admin per plugin assembly, gated by enablement and access

オープン
#3,288 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp

調査の方向性

Read docs/planning/admin-technical-spec.md sections 2.6, 5.1, and 10.4, along with prerequisite A-18. Start by mapping the admin app build, plugin manifest, navigation, and field, widget, and service registries; the issue names no source files or tests for these entry points. Done means the media admin half loads only when enabled and accessible, passes the listed component and end-to-end coverage, and preserves the first-download size budget.

索引モデルが issue の本文から書いたものです。

説明

area:admin type:feature

Problem

Decision 29 asks that each plugin admin half is one assembly, loaded the first time one of its contributions is used, and row 8.15 that a plugin disabled in a site shows nothing there. The app loads every assembly at start, the sidebar and the registries know the core's contributions only, and nothing reads GET /plugins to gate a contribution.

Proposal

  • The app's build gathers the fluentcms-admin.json of every half it references into one file, and lists each half as BlazorWebAssemblyLazyLoad. The shell reads the file at start with one request.
  • The shell shows a contribution from the manifest only while its server plugin is enabled in the site (GET /plugins, read once per site) and the caller holds its permission (IAdminAccess). Both are re-read on a site switch.
  • A half is loaded with LazyAssemblyLoader at the moment the table of 2.6 names: its route in the router's OnNavigateAsync, its field editor or list cell when a form or list with that field type opens, its widget when the home page shows it, its service when it is first asked for. The lookups of the field editor, list cell and filter registries become asynchronous for a type a manifest names; core types stay as they are.
  • Configure runs once per half, into a provider of the half that falls back to the admin's services; the half's components reach it through IAdminPluginServices (AQ4).
  • A half whose AdminRange does not hold the running version is not loaded and is listed on an error page; a half that fails to load shows an error state with a retry, not a blank page.
  • Create FluentCMS.Plugins.Media.Admin under admin/src/plugins/ with its manifest, its manifest test and an empty /media page with its menu item, so that the loading is proven on a real half and A-20, A-21 and A-22 start from it. A half's project takes the component library with PrivateAssets="compile" or what gives the same result, so that a half cannot name the library's types (#3178).

Acceptance

  • The first download of the app does not hold the media half; the network shows it fetched on the first visit of /media, and once
  • In a site where the media plugin is disabled the menu item is absent, /media answers the not-found page, and the half is never fetched
  • A caller without the page's permission sees no menu item, and the route answers the no-access state
  • A service registered in Configure is injected into a component of the half, and is not in the app's container
  • A half outside the admin range is listed on the error page, and the rest of the admin works
  • The download size budget of A-06 still holds for the first download
  • Component tests cover the gating and the registries; an end-to-end case covers the lazy fetch and the disabled site

Design: docs/planning/admin-technical-spec.md, sections 2.6, 5.1 and 10.4 (A-19). Rows 8.15, decision 29. Needs A-18. Size: M.

主要言語
C#
スター
569
フォーク
107
平均マージ
2時間 49分
マージ済み PR(30日)
397

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。