Hey guys - when loading multiple projects, is there a way for initPlasmicLoader and PlasmicRootProvider to fail more gracefully if given incorrect project information?
Right now, if any project has an incorrect id or token, the entire fetch fails with a 403. What I would prefer is that valid projects are returned, and invalid ones are reported as an error.
That’s what we’re doing for now, but it still results in no Plasmic content loading at all if one project is incorrect.
Our use case is that we have a Plasmic project associated with an order in our back-end, and a user has access to any number of orders. We encountered the problem when a project token wasn’t saved correctly for a new order.
Plasmic rejecting the bad project token resulted in nothing loading for our user, instead of only the new project with the bad credentials.
We use the provided page data to dynamically generate a menu. When a user clicks on a link from that menu, we load our Container component that then retrieves the actual page data. PlasmicRootProvider wraps the Container and receives PLASMIC as its loader.
const pageData = await PLASMIC.maybeFetchComponentData(
// menu link page info here
);
You can instead make a separate loader and fetchpages call for each project, would that work in your case? (You can also parallelize these) I can send an example snippet if helpful once I’m back at keyboard later on tonight