(also also, how to format json to register code components?)
Model renderer is not ready yet;
Good point, we’ll update the codegen example with data fetching
What do you mean with the json format registration?
Error encountered while fixing imports for Collection: Error: Encountered code component "Shopify.Collection" that was not registered with an importPath, so we don't know where to import this component from. Please see <https://docs.plasmic.app/learn/code-components-ref/>
"codeComponents": [],
You shouldn’t need to touch plasmic.json for that. Do you have the importPath specified in your registration on your app host? Once you do, reload the project so Plasmic sees the path, and then sync again
Ok I have it almost working - I can’t get it to register the component though.
in app/routes/plasmic-host.tsx
i pushed code here (and added plasmicops): https://github.com/DINGORODEO/hey-gang-hydrogen
do you mean it doesn’t show up in the studio?
no just when i run yarn dev it errors
what’s the error?
Error encountered while fixing imports for Collection: Error: Encountered code component "Shopify.Collection" that was not registered with an importPath, so we don't know where to import this component from. Please see <https://docs.plasmic.app/learn/code-components-ref/>
have you reloaded the project yet once you added the importPath?
like yarn plasmic-sync
? or just yarn dev?
ah I meant reloading it in the studio
that’s how Plasmic gets to see the importPath that you just registered
i can’t get dev to run - so i haven’t pointed studio at it or deployed it
i could be misunderstanding something
ah maybe try editing package.json to remove plasmic-sync from “dev” first so you can bring up the dev server without running plasmic sync first
i see - that kinda works - though I can’t get dev to run for components i’m substituting - since <_PlasmicComponent />_
and I don’t have local components yet without sync
yup you just need to get dev to render the host page so that Plasmic can see the new importPath. Then you should be able to do plasmic sync
again
We’ve updated the example to include data extraction: https://github.com/plasmicapp/plasmic/blob/master/examples/hydrogen-oxygen-with-buildtime-codegen/app/routes/_index.tsx
great playing with this now. Should i be gitignoring app/_plasmic
dir?