I’m in the process of migrating/rewriting an old application (Winforms .Net 4.8) and for various reasons will be mixing standard Winforms based application/controls, Yii2 applications (both REST and Web Controller based), VueJs and Oracle JET; at this stage OJET (JS toolkit to develop SPA, npm/cli for dependencies and build/dev with file watching, live/hot reload, etc.) is being used to provide “mini applications” inside the .Net based application (e.g.: data visualization, Gantt); this works well enough since I can develop the OJET application, run any npm and cli commands to manage dependencies, minification, hot reload, etc. and then when ready just build for release and place the resulting HTML+JS+CSS files in the server and load them inside a form using an embedded browser control (CefSharp).
At some point I’ll need to have these OJET applications “inside” a standard view, meaning I have a Yii2 based application and need to render a partial view that will contain the OJET application. My existing workflow won’t work and I’m looking into ways to automate it and allow development of OJET (or any other similar framework, like VueJS) and integration into the Yii2 based applications.
Things I haven’t solved:
- OJET uses requirejs, that will then manage all the JS loading my app needs, so I’ll have to make sure Yii2 publishes all files/assets; should not be an issue, but I’m still unsure about it;
- When developing, OJET watches changes to my files and “builds” the index.html, CSS and JS files, and deploys them to a build/staging folder; don’t think this will work with asset publishing,or even having a folder in my public/web folder
- There are different files for development and for release, and I need a way to detect that I’m in dev mode or in production mode;
- I need a way to “move” the OJET HTML into a PHP view/file that I can render inside my Yii2 views; this should be easy as I can just remove anything that is not my app’s markup from the compiled index.html file.
So, after all this any suggestions, pitfalls, ideas? Has anyone done something similar to this already that can share some insights into how to improve workflow and, as much as possible, automate the file processing and “view building”?