Package Improvements and Future Ideas #135
Replies: 4 comments 2 replies
-
Photino.NET Project Update (27/02/2024) 🚀Hi, everyone ! I am pleased to provide a brief update on the recent developments within the Photino.NET project. I hope this communication finds you well, and I appreciate your attention to this update. Should you find this platform unsuitable for such information, please feel free to direct your queries to me via private message. Over the past year, since the creation of this discussions, I've not been immersed in the project on a daily basis. However, I have some noteworthy progress to share. Project Naming AdjustmentsFirst and foremost, I observed that all projects are utilizing the name Photino.*, while the namespace is specified as PhotinoNET. This inconsistency prompted me to make a minor adjustment to ensure coherence. While this change may cause some initial dissonance, rest assured it is reversible if it doesn't align with the community's preferences. Within Photino.NET, I have made updates to language conventions. Please review the following code snippet: #if NET7_0_OR_GREATER
[LibraryImport(DLL_NAME, SetLastError = true)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
static partial void Photino_Invoke(IntPtr instance, InvokeCallback callback);
#else
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
static extern void Photino_Invoke(IntPtr instance, InvokeCallback callback);
#endif While it may appear to duplicate code, this adjustment is aimed at supporting .NET 6 until its deprecation. The current configuration, leveraging source generators, enhances project performance without relying on runtime tricks. Additionally, I've incorporated syntactic improvements introduced in C# 12. Development Server Enhancement in Photino.NET.ServerSignificant enhancements have been implemented in the Photino.NET.Server package! The development server has undergone a revamp, inspired by the #121 chat discussion with a special shoutout to @manuel3108 for the initial code! As a React developer, I've created a straightforward static server that intelligently attaches to a local server in DEVELOPMENT and utilizes the wwwroot files in PRODUCTION. To facilitate the transition for AspNET developers moving to Photino, I drew inspiration from the AspNET Core playbook. I introduced a new class, PhotinoApplication, akin to WebApplication, and brought in a PhotinoAppBuilder to enhance the existing WebAppBuilder. Several extension methods tap into the main PhotinoWindow and leverage Microsoft's hosting capabilities. Drawing from my roots in Blazor, I've incorporated tricks from the Blazor version of Photino. For those interested in examining the code, please explore the debug branch in the fork mentioned in the primary discussion post. Introducing IPC (Inter-Process Communication)I have implemented a straightforward Inter-Process Communication (IPC) channel system, inspired by the one found in Electron. Although basic at this stage, it effectively fulfills its purpose. Messages are dispatched to channel listeners, and data retrieval is neatly executed in a type-safe manner. Explore the simple mirroring setup for JavaScript and TypeScript in the Photino.Final.Sample – it serves as a miniature IPC sample! The Final SampleIn conclusion, There is the "Photino.Final.Sample" project. This amalgamation encapsulates all the aforementioned tweaks. To streamline integration, I propose incorporating this project into the sample repository. Simply replace references to other projects with the actual NuGet packages, and we should be good to go! I extend my sincere gratitude to everyone who has contributed to this project! 🚀 Your dedication is valuable, and I value every line of code, idea, and positive energy brought to the table. I am optimistic that this update will be well-received! 🌟
|
Beta Was this translation helpful? Give feedback.
-
Wow, this looks great! Especially the dev server implementation is way more thought through than my POC. Would love to see everything merged! |
Beta Was this translation helpful? Give feedback.
-
@Denny09310 If you would like to create pull requests for Photino.NET, Photino.NET.Server and for your sample (will have to be added to our Photino.Samples repo and use naming conventions similar to existing samples), we're happy to get started with those. We'll work on creating a Photino.NET.IPC repo based on that code. Thank you for all of your hard work. |
Beta Was this translation helpful? Give feedback.
-
Photino.Blazor Project Update (19/04/2024) 🚀Just dropping a note here since I couldn't find an open discussion section on the Photino.Blazor repository. I've been tinkering with some potential tweaks for the Photino.Blazor library and wanted to loop you all in for some feedback. You know, just to make sure we're all on the same page before diving too deep. The Why Behind the ChangesSo, here's the reasons on what's got me thinking:
What's Actually ChangingI managed to implement the And hey, I get it. The whole "internal" thing makes it a tad tricky to access. So if anyone's got some clever ideas, especially for handling different .NET versions, I'm all ears. If any of you want to peek at the code and toss out some thoughts on how we can make things even better, just hop on over to the branch "move-to-hosting" I know you are working hard to make updates and maybe these changes are more of a nuisance than a help, but if you have time to review them I can help improving the library when I have some spare moments |
Beta Was this translation helpful? Give feedback.
-
First of all, I would like to express my appreciation for your great work in creating this library . I am not an expert, but I have some ideas to enhance the project in terms of "quality of life" for development.
One of the main points I would like to suggest is creating a channels system to exchange data from/to the frontend . This can be achieved using a PhotinoChannel class to wrap the PhotinoPayload and a generic payload class instead of a basic string. In addition, including all the javascript frameworks as frontend using the PhotinoStaticFileTemplate can simplify the process and improve the overall user experience .
To further enhance the project, cleaning the code and exposing the builder with the extension method to have the IServiceCollection container can also be beneficial. As a suggestion, creating a class to startup automatically a dev server in background can greatly facilitate the development process. This idea was brought from this discussion
In terms of improvements for javascript/typescript, creating a simple npm package like '@photino/core' to use the window.external methods in a better way can also be a useful addition .
I would like to invite anyone who is interested to help me with these changes. I have already created a fork of any photino project to make the improvements with these changes and would appreciate anyone who can take a look at it. However, I must mention that I do not have access to a Mac, so I am unable to test the changes on that platform.
In addition to the previous suggestions, I have also created a repository with a turborepo monorepo to streamline the development of the proposed npm package. I understand that there are many ideas and tasks involved in this project, but I am passionate about improving this library. Therefore, I invite anyone with expertise in TypeScript and C++ to join me in this endeavor. Together, we can make this library even more useful and efficient for developers.
Thank you for your time and consideration.
PS: If I forgot something I will edit this to add the missing points
Forks:
Beta Was this translation helpful? Give feedback.
All reactions