-
Notifications
You must be signed in to change notification settings - Fork 36
Add plugin support for other templates languages #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
Conversation
I just looked into the PR and noticed a dependency on Let me hear your feedback on this |
If you mean the
I think it's not possible to expose just one type, you have to expose its whole assembly. We can change the above linked code to only expose
Sorry, I don't really understand. This |
Also by importing
So now I'd have to include |
…tractions project.
@hishamco Have you seen my replies? This is not super urgent yet but it would be good if we could have a solution before year's end, because we might need it next month. |
I didn't look into the last comment, but the PR is opened in one tab, so I need to revise it today or tomorrow to proceed |
Hi @hishamco , any news with this? |
NuGet.config
Outdated
<clear /> | ||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" /> | ||
<add key="OrchardCore" value="https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json" /> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> |
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.
The feed is already there?!!
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.
Ooops, I didn't notice. I've reverted the name.
My point was just to remove the OrchardCore
source. It's not even used and because of the central package management this kept giving warning NU1507: There are 2 package sources defined in your configuration.
If you need the Orchard Core preview feed in the future, I suggest adding the full <packageSourceMapping>
configuration, as you can see in OrchardCore.Commerce.
foreach (var plugin in plugins) | ||
{ | ||
var code = await File.ReadAllTextAsync(plugin); | ||
await CSharpScript.EvaluateAsync(code, options, new PluginContext(projectProcessors, projectFiles)); |
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'm not sure why this is in Abstractions while it relies heavily on CSharpScript
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.
Where should it be then?
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.
The reason is that this class only relies on IProjectProcessor
from this project, which is in OrchardCoreContrib.PoExtractor.Abstractions
, so I imported CSharpScript
's package there as well. I think it's appropriate, because this helper is related to extensibility. We can move it into OrchardCoreContrib.PoExtractor
if you prefer.
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've moved it to OrchardCoreContrib.PoExtractor
.
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 am not familiar with POe but anything that is related to c# plugins should be in a separate project or in the main assembly, not abstraction. No reference, no class.
@sarahelsaig Sorry for the late, I revised the code one more time still worried about the impact of dynamic linking, so I'm thinking for two simple approaches:
While this repo is Orchard Core Contrib it SHOULD help any OC project, I might think the first option is better, but I need to hear your feedback. Also, I will think for the last time about dynamic linking and its drawbacks |
Can you explain what is your worry about dynamic linking? What are the drawabacks? I don't see any impact unless you manually opt-in by using the command line switch. Otherwise I think it's safe with only very minimal overhead. I see it as a transparent improvement.
I fully agree with this sentiment. Note that since my original PR, I have seen other highly project-specific opportunities where this feature could be useful. In both of the cases below I could use a PoExtractor plugin to centralize other localization tech so OC can manage the actual localization and then serve it back to the associated tech. This will reduce the number of tools for the staff to learn to do the translations, and make complete translation management easier and safer.
I don't think we should create OrchardCoreContrib.PoExtractor.VueJs, not other OrchardCoreContrib.PoExtractor projects for the use-cases I mentioned above. This would quickly bloat your repo.
I'm not sure if I understand. If you mean using OrchardCoreContrib.PoExtractor as a library inside Lombiq.VueJs, your existing NuGet tool package doesn't make it possible. Even if you released a NuGet library package it would be pointlessly cumbersome to use in my opinion. |
@hishamco Happy New Year! Have seen my last comment? Even if you don't want to go forward with this PR I'd like to understand what's your concern about using C# scripts in this project. Maybe you are right and I should avoid using it in my own projects too. Also just to clear things up, since you mentioned "dynamic linking" in your previous comment. The topic came up in the issue, but in this PR I did not implement dynamic linking. What we have here is just scripting. Similar to using Jint in OrchardCore, except the script language is also C#. |
Happy New Year! Let us finalize the PR this week, it would be nice to demo it in the upcoming meeting if it's possible I need to have @sebastienros feedback |
I'm planning to use CLI parsing package to make things easier, let me create a quick PR to use https://github.com/natemcmaster/CommandLineUtils the you can react to the changes, then we could merge Hope the recording for yesterday's meeting will be published ASAP, I need to have a look before we merge this. No worry we will try to merge this PR this week |
Co-authored-by: Hisham Bin Ateya <hishamco_2007@yahoo.com>
I have rewritten About the recording, maybe it will be faster if you ask for a direct link from someone who is part of the main Orchard org. |
I'm suggesting a new PR for it or I will do it so quick, we need to focus on what it's related to the plugin support Thanks again |
Sure, here is the PR: #104 |
I'm still waiting for Gabor to check the recording, but I will do one more review tonight |
I just saw the recording and heard @sebastienros feedback:
Last not Liquid is already supported and the tool is able to extract the strings https://github.com/OrchardCoreContrib/OrchardCoreContrib.PoExtractor/tree/main/src/OrchardCoreContrib.PoExtractor.Liquid |
Can you elaborate, what relative URL means here? I just use HttpClient without any custom configuration for loading remote plugins, so I think we always need absolute URLs.
Sorry for the confusion, that part is not related to this PR. Just a sudden though I had at the moment. I have created a separate issue to discuss: #105 |
I did a last review, please check and let merge then |
Co-authored-by: Hisham Bin Ateya <hishamco_2007@yahoo.com>
Co-authored-by: Hisham Bin Ateya <hishamco_2007@yahoo.com>
Please comment on #102 (comment) then we can merge so quick |
Thanks so much @sarahelsaig, I think the next step is to publish the abstractions project |
BTW did you start a VueJS localization extractor, or it's something private for Lombiq |
I will start working on it soon (Lombiq/Orchard-Vue.js#152). |
I've thought this through, and I think Roslyn C# script plugins make the most sense. (also to make it work with DLLs you'd have to publish OrchardCoreContrib.PoExtractor.Abstractions to NuGet as a separate library package - probably not worth the effort) I've included a unit test and sample plugin that hopefully gets the point across without being too niche. (The important change is in the
Program.ProcessPluginsAsync
method, the rest is just plumbing.)Fixes #101