Github Actions - Change "Use Workflow" selection from default - reactjs

To make it simple, we're deploying our product via using Github Actions. Also we have a develop branch in which we're running some tests about our product. That's why, we're using develop branch as a default branch since we're opening our pull requests to develop branch automatically
Also we're running a manual workflow for going to production
But
I want to change the "Use Workflow from" branch for a specific workflow since it's showing develop as default in Production workflow
My question is, is there any way that I can show a different branch as default in this dropdown? I wanted to show master branch by default without changing the default branch of the project since this is the production workflow
Thank you all

Related

Best way to keep a React app updated on a linux server

I am currently in college and am creating a portfolio website on my own to set myself apart from other students. I have set up a home Linux server and have hosted a personal website on it.
The issue I'm running into is having to constantly update the website with demos of new projects I've completed. I want to be able to do something like pushing new projects or updates to old projects to GitHub and be able to simply pull the updated repository to my server without having to delete the old project and build the new one on the server over and over.
Is there a best practice for this and does anyone have a good guide or documentation I can follow to figure this out? I know I can simply use hosting services that are drag and drop every time i update the code however I enjoy the complexity of running my own server and figuring out these issues.

How to get the App running both in the integrated and the standalone in single spa

Im new to Single Page Application (SPA).
I created 3 separate applications, where one is the root config app and the other two acts as the child applications.
We need to run one of these child applications separately on its own.
But the deployed application gives the following error:
Your Microfrontend is not here
Can I know how to get it done
Locally it successfully runs when i run it from the
npm run start:standalone command
First: The "Error" you are getting is not an error. A microfrontend (mfe) is a microfrontend and a standalone application is a standalone application. There is a description on the Page of what you have to do to get it running.
I would not recommend running your single-spa MFE in standalone mode, for multiple Reasons which are also stated in the Readme of the standalone Plugin. It also basically just creates a standard small root-config for you to use.
But the biggest reason is that the standard yarn run serve:standalone doesn't create optimized builds, which leads to an increase in bundlesize.
E.G. one of my MFEs is 1mb big if build correctly but is around 13mb big if it's unoptimized. Which is quite noticeable.
If you want to run your Microfrontend without the other one you have two options in my opinion:
Create another Root-Config. Nothing is stopping you to create another
Root-Config and only display a single Component on there. You can even deploy the build of your Root-Config to the same environment of your MFE you are displaying (i don't know your deployment process tho).
Create a Route on your Root-Config which only displays a single Component.
If you still opt to use standalone Mode you will need a Server/Dockercontainer with node and run it in there. I'm not aware of any Buildoutputs of the standalone plugin.

NextJS - Production Hot Reloading

Are there any examples out there of injecting new ReactJS components at Runtime, e.g:
A build is deployed on production is stable and running.
We need to add a component or a new route without running through an entire deploy process.
An additional usecase : the application ships with all the components ( e.g: A CMS Module library) - Only certain components were enabled in layout at build time but need more to be added later via a config.
Approaches I have considered.
Using next getStaticPaths and then using a override in the front-end to inject client side components. This will most probably be seen at runtim
Use a more faster deploy system - This is more obvious but imagine lots of changes within a day and multiple deploys.
Any similar problems or approaches people would have tried would be great.
Update Nov 2022
If you are searching on the internet and this comes up, Zack Jackson's Module Federation supposedly achieves this and is called live code sharing via Module federation - https://module-federation.github.io/ There is a NextJS Paid plugin https://app.privjs.com/buy/packageDetail?pkg=#module-federation/nextjs-mf (supports only CSR currently)
I think you would lose out on a lot of built-in build optimizations from Next by trying to circumvent the standard build process, e.g. automatic code-splitting as described here.
However, you might find the fallback feature solves your problem entirely - the fallback feature was meant for large ecommerce sites like it sounds like you're working with. As stated at the fallback true docs:
useful if your app has a very large number of static pages that depend on data (think: a very large e-commerce site). You want to pre-render all product pages, but then your builds would take forever.

Setting build mode flags in angular app

I have a scenario in my angular app where I want to set some properties based on whether the app has been built in debug or release mode from a build task in my gulp file.
Basically I have code that should only be run when the app is built in debug mode (some code that uses the $interval service).
All I can think of right now is setting an angular constant to say what mode the app is running in, but it would mean changing it each time I want to build for debug or production\release mode. It would be nice if I can somehow get the build tasks to set some global that the client side angular app can get at.
I'm using Express as well, so I did wonder if maybe an environment variable could somehow be supplied to the client side code?
Has anyone encountered a similar situation and can offer suggestions for a suitable solution?

Is there a way a method can be triggered or run during a salesforce package installation process?

I would want to do this to run post installation setup process like adding custom data that is required for the application to run.
One option I am aware of is to Write Installation and Setup instructions for users. Create visualforce page and include a button on this page. Redirect user to this page as the process of Installation and ask the user to click the button.
I only wanted to know If there was a more elegant way to solve the problem and if there is a way to call a method during the installation process.
Salesforce has recently implemented the ability to execute scripts (as Apex) during package Install / Uninstall:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_install_handler.htm
No, we can't have a post installation script for the app. What you are saying is best solution, just keep a custom setting to flag, if initial setup is not done, then redirect to the setup page first, other wise do the normal work.
My question would be revolving around why you need custom data for the app to run? One of the things Salesforce look for when doing a security review of your code and the unit tests you have is to check to see if you are requiring data in your org as this is bad practice. Note that if your app is requiring specific data to run then it cannot be tested properly as the data will not be in the org when running the tests on install.
What is the data you are requiring? Could it be stored in an xml like static resource file or something similar for you to load and parse as it is needed?
Paul

Resources