If using the pancetta, brown it lightly in olive oil in a large skillet or sauté pan and remove.
If not using pancetta, start with the shallots and let them gently sauté in olive oil for a minute or two until soft. Add the artichoke wedges, season with salt and pepper, then give them a turn. Drizzle on some white wine and let it evaporate. Add some water and let the artichokes braise until tender, usually just 5 minutes or so.
Meanwhile, put a large pot of salted water to boil and cook the pasta until al dente.
Also whisk the eggs and grated cheese together in a small bowl. Season generously with freshly grated pepper.
When the pasta is done, transfer it to the skillet, along with a ladleful of the pasta cooking water and, if using, the reserved pancetta. Toss well and let the pasta simmer for a few moments to let the flavors meld. Turn off the heat.
Immediately add the egg and cheese mixture and stir very vigorously just until it has thickened enough to coat the pasta.
Serve right away.