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: optimize the MoleculeProvider #517

Merged
merged 15 commits into from
Nov 30, 2021
Merged

refactor: optimize the MoleculeProvider #517

merged 15 commits into from
Nov 30, 2021

Conversation

wewoor
Copy link
Collaborator

@wewoor wewoor commented Nov 23, 2021

Overview

Refactor the loading logic of Extensions in MoleculeProvider.

Changes

  • Remove the colorTheme props from MoleculeProvider
  • Remove the container property getter of MoleculeProvider
  • Rename initControllers to initWorkbenchUI
  • Extract the splitLanguagesExts method into ExtensionService
  • Refactor the initialize logic to:
    initWorkspace -> initLocaleExts -> initWorkbenchUI ->load(defaultExtensions)-> load(resetExts)

@wewoor wewoor requested a review from mortalYoung November 23, 2021 05:56
@wewoor wewoor added the bug Something isn't working label Nov 23, 2021
@wewoor wewoor added this to the 0.9.0-beta.1 milestone Nov 23, 2021
@wewoor wewoor self-assigned this Nov 23, 2021
@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #517 (21939fe) into main (14c6057) will increase coverage by 0.91%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #517      +/-   ##
==========================================
+ Coverage   85.58%   86.50%   +0.91%     
==========================================
  Files         182      188       +6     
  Lines        5307     5476     +169     
  Branches     1189     1213      +24     
==========================================
+ Hits         4542     4737     +195     
+ Misses        758      729      -29     
- Partials        7       10       +3     
Impacted Files Coverage Δ
stories/extensions/test/testPane.tsx 47.05% <66.66%> (ø)
src/molecule.api.ts 100.00% <100.00%> (ø)
src/provider/molecule.tsx 100.00% <100.00%> (+97.22%) ⬆️
src/services/extensionService.ts 100.00% <100.00%> (ø)
stories/extensions/data-sync/index.tsx 71.42% <100.00%> (ø)
stories/extensions/locales-plus/index.tsx 80.00% <0.00%> (ø)
stories/extensions/problems/index.tsx 75.00% <0.00%> (ø)
stories/extensions/test/index.tsx 24.19% <0.00%> (ø)
stories/extensions/index.ts 100.00% <0.00%> (ø)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14c6057...21939fe. Read the comment docs.

@wewoor wewoor changed the title refactor: optimize the MoleculeProvider refactor: optimize the MoleculeProvider Nov 23, 2021
src/provider/molecule.tsx Outdated Show resolved Hide resolved
@wewoor wewoor requested a review from mortalYoung November 24, 2021 03:54
.github/workflows/main.yml Outdated Show resolved Hide resolved
@wewoor wewoor requested a review from mortalYoung November 29, 2021 05:45
@wewoor wewoor force-pushed the fix/moleculeProvider branch from 923832d to 21939fe Compare November 29, 2021 11:39
Copy link
Collaborator

@mortalYoung mortalYoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@wewoor wewoor merged commit 8fc4e62 into main Nov 30, 2021
@wewoor wewoor deleted the fix/moleculeProvider branch November 30, 2021 02:27
wewoor added a commit that referenced this pull request Dec 1, 2021
* refactor: update the MoleculeProvider

* fix(molecule provider): init workbench ui after init locales

* test: unit test for splitLanguagesExts

* docs: comments for MoleculeProvider

* test: unit test for MoleculeProvider

* refactor(i18n): update the apis of locales

* fix: correct the reset to rest

* chore: ignore website prettier

* style: prettify code

* test: update the snapshot case

* test: remove the snapshot

* test: update snapshot

* ci:  yarn test -u

* ci: remove the -u argument of yarn test

* test: update the MoleculeProvider snap
wewoor added a commit that referenced this pull request Dec 6, 2021
* docs: update the introduction

* docs: update the Introduction of zhCN version

* docs: tutorials for keybinding, quickAccess and Icon

* feat: improve homepage (#527)

* build: update the limitation of node version (#515)

* fix: fix can't clear the notifications (#518)

* fix: fix can't clear the notifications

* test: update tests

* test: ignore render tests

* fix: fix create file node incorrect on contextMenu (#522)

* refactor:  optimize the MoleculeProvider (#517)

* refactor: update the MoleculeProvider

* fix(molecule provider): init workbench ui after init locales

* test: unit test for splitLanguagesExts

* docs: comments for MoleculeProvider

* test: unit test for MoleculeProvider

* refactor(i18n): update the apis of locales

* fix: correct the reset to rest

* chore: ignore website prettier

* style: prettify code

* test: update the snapshot case

* test: remove the snapshot

* test: update snapshot

* ci:  yarn test -u

* ci: remove the -u argument of yarn test

* test: update the MoleculeProvider snap

* fix: show the SubMenu in right place when the Menu is horizontal mode (#526)

* fix: show the submenu in right place when horizontal mode

* test: update the snap of Menu

* feat: support sort in folderTree (#524)

* feat: support sort in folderTree

* feat: improve check hidden files

* docs: update Guides

* docs: unify the files name

* docs: update Guides, Overview

* docs: update the QuickStart

* docs: update the first extension

* docs: update the extension guides

* docs: update Workbench UI

* fix: improve the circular dep error when execute yarn link (#528)

* fix: remove the warning in console (#529)

* fix: remove the warning in console

* test: update snapshots

* docs: update ColorTheme, readme, keybinding, i18n

* docs: update Keybinding

* docs: update quickAccess, add demo tips

* docs: update i18n

* docs: update Settings guide

* docs: update Icon guide

* docs: update customize the Workbench guide

* docs: update images

* docs: update Contributing

* docs: update English version

* fix: remove the 140 width limit for buttons

* docs: default locale is zh-CN

* docs: improve the links (#533)

Co-authored-by: 野迂迂 <yangwei1@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants