Implement PoC (proof of concept) of the State Management that increase performance

未关闭
#231 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@korel-san 已经在做这个了。

开始于 2023年2月14日。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
typescript
领域
frontend

调研方向

首先,根据所述的轻量、简单、routing-subscription 和会话存储标准,调查 elf、effector 和 ng-state。然后,在创建 src/state/actual-route-state.repository.ts 之前,检查现有的 routing-state 解析以及 StringHelpers.encodeObjToUrlString 的使用情况。完成的标准是:通过一个仅限本地使用的 repository 提供统一的 actual route state,并且 production 中不存在任何实例。

由索引模型根据 Issue 内容生成。

描述

Tech debt

The main goal of the task: create State Service that contains the parsed actual route state.

More details:
The routing state depends on the page and functionality of the page. Now many components trying to parse it, which increased code duplication and worked not properly in some cases. So, for the unification of the actual routing state, we consider separating functionality in service, which would handle the actual route state, and every component would be asked from its real data for their purposes.
We don't want to use current state management ngrx due to the high level of tied dependency of the current implementation, so not to add extra naming and have a more lightweight solution, we want to use another tool for this PoC will allow us to not affect the current performance.

Actual implementation plan:

  1. investigate 2-3 state management packages: elf, effector, ng-state
    Points on which we need to focus
  • it should be lightweight
  • it should be pretty simple
  • package should allow to manipulate of routing (subscription, session storage)
  1. create a state folder in the src and add there actual-route-state.repository.ts. In this file, we need to create a repository that would manage the routing state. Please, take into account, that this state management should work only for the local environment. On prod env, this instance should not exist.
  2. In some cases probably you will need to create Adapters that would convert the current routing state to a meaningful one. For example for pages where we have protected query parameters via the encoding of StringHelpers.encodeObjToUrlString. So after this implementation, every developer should be allowed to see the state of this service on every page of the project.
主要语言
TypeScript
星标
12
派生
7
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AbsaOSS/spline-ui 的其他 Issue

查看 AbsaOSS/spline-ui 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。