Use IHostApplicationBuilder interface and improve code style#1
Merged
DericHuynh merged 10 commits intomainfrom Oct 22, 2025
Merged
Use IHostApplicationBuilder interface and improve code style#1DericHuynh merged 10 commits intomainfrom
DericHuynh merged 10 commits intomainfrom
Conversation
* Implemented custom IComponentActivator to allow for constructor injection. * Added Tests for ComponentActivator * Remove changes made by my Code Cleanup profile. * Fixed accesibility modifiers of test classes.
Co-authored-by: LittleCloud <littlecloud@LittleClouds-MacBook-Pro.local>
…or custom translators (RazorConsole#36) * Initial plan * Expose IVdomElementTranslator and replace MEF with Service Provider - Made IVdomElementTranslator and TranslationContext public - Made VdomSpectreTranslator public with public constructor - Exposed utility methods as public static methods - Made IAnimatedConsoleRenderable public - Removed MEF (System.Composition) dependency entirely - Created VdomTranslatorServiceCollectionExtensions for registering translators with priority - Updated AppHost to register default translators via DI - Updated ConsoleRenderer to accept VdomSpectreTranslator from DI - Updated all translator files to remove [Export] attributes - Updated all Razor components to remove System.Composition using - Created TestHelpers for test renderer creation - Added CustomTranslatorTests to validate custom translator registration - All 63 tests pass successfully Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> * Restructure VDOM translators based on review feedback - Moved IVdomElementTranslator to its own file with Priority property - Moved TranslationContext to its own file (no longer nested) - Converted all translator classes from nested to standalone classes - Each translator now implements Priority property directly - Removed PrioritizedTranslator wrapper class - Removed IPrioritizedTranslator interface - Updated registration to use Priority property from interface - Updated all tests and helper methods - All 63 tests pass successfully Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> * Add comprehensive design doc for custom VDOM translators - Created custom-translators.md with detailed guide - Covers architecture, built-in translators, and extensibility - Includes examples for creating custom translators - Documents utility methods and best practices - Provides troubleshooting and testing guidance Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> * Refactor Vdom translator registration to use CreateDefaultTranslators method for improved maintainability and ordering * Update README with custom translators section - Added comprehensive Custom Translators section after Built-in Components - Includes example of creating a custom translator (OverflowElementTranslator) - Shows registration pattern using AddVdomTranslator - Demonstrates usage in Razor components - Links to detailed design doc for advanced scenarios Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> * Change VdomSpectreTranslator to order translators by ascending priority --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> Co-authored-by: LittleLittleCloud <g2260578356@gmail.com>
* Initial plan * Add Discord badge and server link to README Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> * Move Discord badge to separate line Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
…onsole#23) * Implement using background service and HostApplicationBuilder. Facilitates using other hosted BackgroundService(s) to update the UI * Fix style * Some tidy up, dont bury exceptions from a faulted service * Bump the package minor version * Update src/RazorConsole.Core/AppHost.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com> --------- Signed-off-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com> Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…licationhostbuilder (RazorConsole#41)
- Change HostApplicationBuilder to IHostApplicationBuilder for more flexibility - Separate CreateApplicationBuilder from UseRazorConsole for cleaner code style - Update tests to follow non-fluent pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the following changes:
This addresses issue RazorConsole#41 by moving the extension method to work with the interface instead of the concrete implementation, allowing users to use other implementations such as WebApplicationBuilder.
Changes: