Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeORM shim to use entities in Next.js frontend #384

Closed
wants to merge 2 commits into from

Conversation

jaredcwhite
Copy link
Collaborator

(Coming soon with DB backend, not yet activated)

This was part of a previous PR that got overwritten, but since we haven't yet fully switched to the DB backend, we wouldn't have wanted to roll it out without keeping it under wraps for the time being. So this PR adds the functionality for the frontend to potentially use the backend TS interfaces but doesn't yet activate it.

(coming soon with DB backend, not yet activated)
@exygy-dev exygy-dev temporarily deployed to bloom-refere-add-typeor-tcvsxu July 1, 2020 19:44 Inactive
@jaredcwhite jaredcwhite temporarily deployed to bloom-refere-add-typeor-tcvsxu July 1, 2020 19:45 Inactive
@jaredcwhite jaredcwhite requested a review from bk3c July 1, 2020 19:59
@@ -0,0 +1,183 @@
/* eslint-disable */

// columns
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this file is essentially cut & pasted from the shim provided by TypeORM. Do we want to host our own version of this, or should we literally use the shim provided by TypeORM? We could adjust the webpack config to look in node_modules:

resolve: { // see: https://webpack.js.org/configuration/resolve/
  alias: {
    typeorm: path.resolve(__dirname, "../node_modules/typeorm/typeorm-model-shim")
  }
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make one modification, but it was something they actually should have included in that file, so theoretically if it got upstreamed we could pull it from the module dir. But for now we need to keep it in-repo.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredcwhite Does this PR resolve the issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bencpeters Unfortunately not — the shim is missing BaseEntity for some reason, I had to add it in.

@bk3c
Copy link
Contributor

bk3c commented Aug 10, 2020

Closing this in favor of swagger-axios-codegen and/or its successor.

@bk3c bk3c closed this Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure out how to keep Typescript definitions of core objects in sync.
4 participants