Replies: 1 comment 1 reply
-
You need to disable class name mangling, this is not just a validation on the ORM side, your class name needs to match, otherwise you won't be able to manage such entities. Methods like If you can find a working way around this, I would love to accept a PR, but I don't see one right now. Particularly the duplicates are a no-go, we use the names as keys for various maps. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Currently when using
EntitySchema
to create schema, ifclass
is set,name
orclassName
will be ignored and is inferred fromclass.name
. However, if the class name is mangled (changed to something shorter, which is a common optimization process), the inferred name will become something strange. If entities are in multiple files, the mangling process usually uses duplicate names for multiple classes, causing conflicts when entities are being discovered.Describe the solution you'd like
Just allow setting
name
andclassName
explicitly whenclass
is set and use the explicit values.Describe alternatives you've considered
Haven't thought of alternatives, but I think the solution above is straightforward and not causing any confusion.
Additional context
Turning mangling off can fix it, but I would like to keep it since it can optimize file sizes and keep our source code more secret.
BTW, we are using Next.js for full stack development, but it seems the default decorator approach doesn't work for Next.js. Maybe it is also related to the optimization process. Is there any way to use decorators in Next.js projects?
Beta Was this translation helpful? Give feedback.
All reactions