Hello, I’m trying to come up with some way of sharing resources, AKA services, types, etc, between Forge “back end” and my static Custom UI project.
So, I need to use the same methods to achieve different results in a static module and a UI kit module, is there a way to do this easily other than declaring these methods in a resolver function?
This doesn’t solve the problem of sharing types either - is it ok to import to a Forge UI kit or backend project resources from static modules (not that easy due to “create-react-app” limitations) or vice-versa?
I would suggest creating a separate package with the common/shared types/functions which you then add to your ui kit and create-react-app package.json files.
Hi @RyanBraganza, thanks for your answer.
This sound interesting enough but can you please elaborate a little bit more on it? I’m not totally sure what you mean when you refer to “creating a separate package”, like in a new separate project to share as a dependency or how?
Exactly. You can create your own (public or private) package with the shared code. e.g. on npm About private packages | npm Docs
Sounds great, but do you happen to know if there is a way to include this new package as a part of the forge tunnelling reload process when there are changes? Otherwise, while developing, this is going to be very inconvenient.