typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
414 stars 75 forks source link

Remove SearchOnlyDocuments circular dependency #97

Closed francoislg closed 2 years ago

francoislg commented 2 years ago

Change Summary

There seem to be an issue when building a production build, specifically using Vite.

Documents.RESOURCEPATH returns undefined. Since this is a getter defined in SearchOnlyDocuments and Documents gets it by inheritance, I figured we could probably just remove the reference to Documents.

I think the issue is caused by the circular dependency between SearchOnlyDocuments and Documents and gets a bit muffled at build/shrinking time, so this looks like a proper fix.

I can confirmed it resolved our issue on our side.

See associated Slack thread

PR Checklist

jasonbosco commented 2 years ago

Thank you @francoislg!