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

Fix issue where some Typescript based project transpiler might mangle the table or Reducer #35

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

hsreina
Copy link
Contributor

@hsreina hsreina commented Mar 12, 2024

Related to this issues, /issues/31

This commit change the way the table and reducer are registered to prevent an error message like Could not find class "Person", you need to register it with SpacetimeDBClient.registerTable() first to happen.

Some Typescript based project change the name of the classes when beging converted into javaScript. This behavior prevent the Tables and Reducer to be registered with the right name.

I used the name who are found in the auto generated TypeScript code.
reducer.reducerName for the reducer and table.tableName for the tables

Copy link
Collaborator

@drogus drogus left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. tableName and reducerName were added exactly for this purpose, but I guess we have never started using them

@drogus drogus merged commit 5698991 into clockworklabs:main Mar 12, 2024
1 check passed
@hsreina
Copy link
Contributor Author

hsreina commented Mar 12, 2024

@drogus I can see a new published version on npmjs (0.8.2) but the published files do not have the changes? Forgot to build?

@drogus
Copy link
Collaborator

drogus commented Mar 12, 2024

@hsreina I have released before I merged your commit, but I can cut a new release tomorrow

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.

2 participants