Setting up Next.js app with Plasmic code components

I had a suggestion but beyond that; I just want to verify that current state … based on what I’m seeing in the “setting up an app host” under the “code components” information in the documentation; it seems like it is reasonable to assume that you can have a Next.js project using the App Directory and you can have code components using Codegen. Since there isn’t documentation for Codegen under the “Developer guide” > “Setup” > “Next.js” then I’m assuming at the Project level; Next.js isn’t supported?

Specifically, where I’m getting particularly stuck is having a page that uses the App Router structure and having it connect to a page within Plasmic. Since the option within “plasmic init” “config” skips the question of asking which directory you want to use; I feel like it would be a manual operation; so that leads me to wonder is it a simple as changing the directory structure for that page in the plasmic.json file? I feel like it wouldn’t be because of how the naming convention is setup…

You should be able to move the files around, and update the path in plasmic.json (or, upon next plasmic sync, it should attempt to find the missing files and update plasmic.json by itself)

gotcha; I was tinkering w/ it a little bit this weekend and decided to just stick w/ the Pages Directory. I was finding that even if the pages got to the right destination; there are different imports depending on which route experience you’re going for so even if the files got moved around, there was also some other updates that needed to happen.

yeah we definitely recommend staying with pages router for now :sweat_smile:

yup! I feel OK about that at this point! And totally appreciate all of the underlying work that goes into Plasmic to make things work so seamlessly. I know I’m going about things in a very roundabout way; but as I go through and break things for myself, I’m learning enough of the underlying tech that I think I need to know whats going on under the hood.

I have a Computer Science degree, but never actually used it for programming; so this is my way of getting back into it; but only ever learned Java and C++ and alittle C; so getting to understand Javascript via the Next.js framework and using React is a whole new experience for me.

So, I’m still in the tinkering stages just trying to see how it all fits together and works. My goal is to know the steps well enough that if something breaks, I have a good enough idea how to fix it; and I’m definitely breaking a lot as I go, so I’m feeling pretty good about it

that’s awesome, let us know how we can help :slightly_smiling_face:

I spend a lot of time in the docs and sometimes notice errors, i’d be happy to open PRs whenever I notice something if ya’ll make your docs editable