-
Notifications
You must be signed in to change notification settings - Fork 129
Help System as a standalone PowerShell Module #102
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
Help System as a standalone PowerShell Module #102
Conversation
Help system is used predominantly in interactive sessions and hence not required for automation scenarios. | ||
Since, it is part of System.Management.Automation.dll it is always loaded with PowerShell. | ||
Help system is sizeable piece of code, which increases the runtime footprint of the process. | ||
This RFC proposes to make the help system a PowerShell module, so it is loaded only when used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add HelpSystem abstract class to allow customers to implement help system themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intend to implement a plugin model. Since that is implementation detail, I did not include it in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have thoughts on public api's, I think it's worth including here or note that it'll be in a separate RFC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It make sense to write this explicitly that users can implement custom Help system module based on new public API..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update this to specific the new public APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the intention is to make a plugin model will this root code in the engine? I would see all help root code in a separate module, and plugins in other modules.
| UpdatableHelpCommandBase | Used by UpdateHelpCommand, breaking change impact is medium. | ||
| UpdateHelpCommand | Sealed class, breaking change impact is low. | ||
|
||
[CLR Type Forwarding](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/type-forwarding-in-the-common-language-runtime) will be considered to lessen the impact of the breaking change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should state this as main solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will mostly likely be used. I still need to investigate the impact if the forwarded type is not found, for example Microsoft.PowerShell.HelpSystem module is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this might not be feasible as type forwarding only works if the namespace is same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could place mandatory types in mandatory assembly (maybe leave in SMA) and any extentions put in optional assemblies (and maybe another namespace).
HelpSystem is based on help providers so we could consider to make the help providers as optional and loadable.
This is great, love it |
7da9286
to
1a682e4
Compare
@PowerShell/powershell-committee has decided to take this into the experimental folder so that we can begin prototyping/implementing without blocking on a vote. I personally want to follow up on the CLR type forwarding aspect of this scenario, so @adityapatwardhan and company are going to be doing some investigation there as part of the prototyping effort. |
|
||
[CLR Type Forwarding](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/type-forwarding-in-the-common-language-runtime) will be considered to lessen the impact of the breaking change. | ||
|
||
The interactive user experience would not change as command discovery will find the ```Get-Help```, ```Save-Help``` and ```Update-Help``` commands from the 'Microsoft.PowerShell.HelpSystem' module instead from 'Microsoft.PowerShell.Core' module (System.Management.Automation.dll). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure that scripting scenarios with fully qualified module names (Microsoft.PowerShell.Core\Get-Help) is NOT broken. PowerShell engine should support both - old module qualified names and the new module qualified names.
Plan to implement: Yes | ||
--- | ||
|
||
# Help System as a standalone PowerShell Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should put this new module behind experimental flag.
@adityapatwardhan there's some comments that need to be addressed before @PowerShell/powershell-committee will review |
I tried decouple in https://github.com/iSazonov/PowerShell/tree/helpsystem (not finished, now stopped on res files and HelpV3_format_ps1xml.cs)
Perhaps it is better to migrate to markdown before the decouple - this will remove many dependencies and make it easier the decouple. |
@PowerShell/powershell-committee agrees that this might still be relevant for the 7.1 timeframe, but @adityapatwardhan is busy with some stuff and will come back to the RFC at a later date. |
I still believe we could decouple Help System from Engine in the first step. This simplify next steps. While @adityapatwardhan is busy anybody from MSFT team could help me to finish the work. This shouldn't change current behavior and add a breaking change but will add a new temporary public API. |
## Updatable help | ||
|
||
Updatable help will be updated to directly consume markdown help content. | ||
It includes adding the markdown help content into the cab / zip files of help content that is downloaded. | ||
CommandHelpProvider and HelpFileHelpProvider will be updated to consume markdown help content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This! I'm definitely on board. I think many people get stuck only using comment-based help because of the difficulty in the approach to help documentation. This would probably be able to approach solving issues that continue to pop up like what's seen here: MicrosoftDocs/windows-powershell-docs#139
If the barrier-to-entry for making help documentation was improved like this, it would be a big deal. Without something like platyPS to help, MAML-xml is a rough world to wrap toolchains around. Though, I don't have much experience with platyPS, myself.
Just to reiterate, we're still too busy to do this one within the PowerShell Team, and @adityapatwardhan does have a WIP PR, but we do think that it's fine to proceed forward if someone has the right expertise to do it. That being said, they should comment here and make sure to coordinate with @adityapatwardhan to avoid duplicating work. |
Can you point the PR? |
This RFC is mostly dependent on solving the CLR type forwarding problem and implementing the concept of PowerShell "subsystems" or non-module code. While this is something PS Team would like to do at some point, it's not currently a priority, and we would want to re-visit the thinking completely after those other problems are solved. We spoke to @adityapatwardhan offline and determined that withdrawing the RFC would be the best path forward (at least for now). |
I hope MSFT continues public discussion in new RFC since new subsystem concept looks great. Main questions:
I believe we could start to develop new Help subsystem (as experimental feature) in any time so that overlap current Help module in runtime on the fly.
I guess the decoupling (with new Help subsystem stub) could be done by MSFT team in hours. Or I'd do this. At least we could pull a draft and discuss. With having Help subsystem stub you open a way for community contributions. It seems @daxian-dbw said that MSFT team would implement a subsystem(s) to get an experience. Why did not start with Help subsystem? This is faster and easier to do, and has less negative impact on compatibility. |
@iSazonov: these are good questions, but right now we're driving the subsystem work through some internal business needs we have for decoupling DSC and remoting functionality from the PowerShell engine. Another reason for doing this with something more complicated first, rather than with the help system, is because the help system may drive a more limited design that precludes flexibility and more advanced subsystems in the future. Given that, we're going to close this RFC to be potentially be reopened in the future when subsystems are further along and we want to revisit the help system. |
@joeyaiello I understand and support your plans.
So maybe we should partially separate this module from the engine now. (My PR is still open.) |
This RFC proposes making HelpSystem as a standalone PowerShell module and remove it from System.Management.Automation.dll.
This change is