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

Refactored resource explorer as well as related components #2342

Merged
merged 32 commits into from
Jul 30, 2020

Conversation

chon219
Copy link
Member

@chon219 chon219 commented Jun 13, 2020

Fixes #1959

Description

Changed some components from interfaces to abstract class to align with dotnet sdk
Refactored resource explorer to support more resource types besides ".dialog"
Refactored event emitters to expose add/change/remove events on resources
Clean up unused code and unused dependencies in botbuilder-dialogs-declarative

Specific Changes

  • Resource: interface -> abstract class
  • ResourceProvider: interface -> abstract class
  • use chokidar instead of node-watch to expose added/changed/removed events on resources for tracking resource changes more precisely
  • let LanguageGeneratorManager use resource explorer to track LG files changes
  • removed unused components like FileResourceProvider
  • removed unused resource files

Testing

Test cases added to test resource changes tracking by resource explorer.

@coveralls
Copy link

coveralls commented Jun 13, 2020

Pull Request Test Coverage Report for Build 151793

  • 121 of 130 (93.08%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 82.692%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-dialogs-adaptive/src/languageResourceLoader.ts 7 9 77.78%
libraries/botbuilder-dialogs-adaptive/src/generators/languageGeneratorManager.ts 8 15 53.33%
Totals Coverage Status
Change from base Build 151592: 0.05%
Covered Lines: 14704
Relevant Lines: 16900

💛 - Coveralls

Copy link
Member

@stevengum stevengum left a comment

Choose a reason for hiding this comment

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

It looks like there is some cleanup that can be done in both JS and .NET. Please see feedback

@chon219 chon219 requested a review from a team as a code owner July 23, 2020 08:15
"codelyzer": "^4.1.0",
"mocha": "^6.2.3",
"nyc": "^15.1.0",
"source-map-support": "^0.5.3",
"ts-node": "^4.1.0"
},
"scripts": {
"test": "tsc && nyc mocha tests/",
"test": "tsc && nyc mocha tests/ --exit",
Copy link
Member

Choose a reason for hiding this comment

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

Intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we added some tests to test if resource explorer can monitor folder changes continuously, which may prevent mocha tests exiting as usual. Any better suggestions?

@GeoffCoxMSFT
Copy link
Member

IMHO - it is fine to have an abstract base class for providing default implementation shared across derived classes. However, I don't think this has to mean removing the interfaces. By removing the interface, the other classes become dependent on a specific implementation. Interfaces do a good job of defining the contract in Typescript and get compiled away. There aren't the same tradeoffs between ABCs and interfaces like there are in .NET.

@stevengum stevengum dismissed their stale review July 28, 2020 05:54

out of date

@stevengum stevengum merged commit a067d2a into master Jul 30, 2020
@stevengum stevengum deleted the zim/resources branch July 30, 2020 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants