POC: switch to Node.js Swiss Ephemeris binding #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof-of-concept implementation. I got rid of all calls to starAPI, making working with the ephemeris data more practical and increasing response speed (and also improving development experience by reducing the amount of projects that need to be bootstrapped). This also allows for more sophisticated feature implementations in the future, like calculating subsequent events — that could potentially require the generation of hundreds, or even thousands, of future charts in a sequence, which would be impracticable with the current approach, I guess.
I've also included all the ephemeris files, as instructed by the
swephmaintainer, but not sure if I really needed to commit them here, because they're not exactly light files to be in a versioned repository. Maybe they could be included only at build time......and that brings me to the next issue: the only reason this is a POC is because Vercel + Next.js don't seem to like resource files that aren't explicitly required in the code, so this whole thing could backfire and get discarded. Issue mentioned in the source.
The app should look and function EXACTLY the same as before, just be aware that:
swephlib have a higher precision than those returned by the command lineswetestexecutable, so angles and positions might vary slightly — the reason for that isswetestcuts out decimal cases for nicer output, whileswephkeeps the raw numbers/ephefolder is not found by thesweph.set_ephe_path()function, the lib will fall back to using the Moshier Ephemeris, which is less precise and will spit out (considerably) different numbers