Note: you can make the caramelized onions ahead of time and store it in the refrigerator, in an air-tight container. Warm it up slightly before adding to the dip mixture.
Half the onions, cut off the tip, peel the outer skin, and slice onion thinly to the root. Discard the tip and the root.
Heat up a cooking pan over medium heat and add butter and oil. Add sliced onions and season with a little salt. Mix onions to evenly coat them with oil and seasoning.
Cook over medium heat, stirring from time to time, until you notice most of the liquid cook out and onions start to get browned.
Lower the heat to medium-low and cook until onions are caramelized to nice brown color all over. Stir onions every 5-10 minutes white they're cooking. If onions seem a little dry, add about 1/2 tbsp of butter. (Don't try to rush the process or you will end up with sautéed or crispy onions and not caramelized. This process will take 20-30 minutes.)
Preheat the oven to 350° and lightly grease a ceramic or glass baking dish.
In a medium bowl, mix all the ingredients except for caramelized onions until smooth.
Fold in caramelized onions and transfer the mixture into an oven-safe dish. Sprinkle with a little extra shredded cheese on top.
Bake for 15-20 minutes, until the edges just start to bubble.