Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: config #214

Merged
merged 5 commits into from
Dec 7, 2022
Merged

refactor: config #214

merged 5 commits into from
Dec 7, 2022

Conversation

hyj1991
Copy link
Member

@hyj1991 hyj1991 commented Dec 6, 2022

背景

旧的 config 逻辑分散在 js / addon 两层,默认配置也分别在 js / addon 两层定义,配置逻辑比较混乱。

这里重构为:

  • js 层配置收敛仅在 configuration.js 申明
  • addon 层 ConfigStore 取消重复定义,修改为 json 对象动态存取

新增配置

需要新增配置,配置自身的逻辑上只需要:

  • 修改 configuration.js,增加配置各项属性

这样一处修改即可完成配置新增和使用。

测试

本 PR 不涉及到对外逻辑改动,重构功能依靠已有单元测试保证

@hyj1991 hyj1991 marked this pull request as draft December 6, 2022 15:56
@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #214 (f06d903) into master (ea2e7f8) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #214   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9        10    +1     
  Lines          296       305    +9     
=========================================
+ Hits           296       305    +9     
Impacted Files Coverage Δ
configuration.js 100.00% <100.00%> (ø)
lib/configure.js 100.00% <100.00%> (ø)
lib/utils.js 100.00% <100.00%> (ø)
xprofiler.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hyj1991 hyj1991 marked this pull request as ready for review December 7, 2022 05:27
@hyj1991 hyj1991 merged commit 85065b8 into X-Profiler:master Dec 7, 2022
@hyj1991 hyj1991 mentioned this pull request Dec 11, 2022
hyj1991 added a commit that referenced this pull request Dec 11, 2022
Commits:

  - [bfe59c1] feat: support http profiling (#215)
  - [85065b8] refactor: config (#214)
  - [ea2e7f8] fix: avoid copying constant strings (#212)
  - [5b157fe] fix: remove unused dump action field (#211)
  - [840df2a] refactor: consolidate dump actions (#210)
  - [289770f] refactor: js bindings (#209)

PR-URL: #216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants