Proposal: A tool for generating a deno-optimized version of the driver #830
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 PR contains a script which I used to auto-generate a Deno version of
neo4j-driver-lite
. If you are interested in officially supporting Deno, this is one way to do so.Background
Prerequisites
While working on Deno, I found and fixed a bunch of other issues in the codebase. To make the review easier, I have separated them into smaller, simpler pull requests:
This PR includes all the commits from those PRs because they're required. Once they are merged, the diff of this PR will be much smaller (really just the one commit 73981b1).
Whether or not you are interested in merging this PR, I do hope you can merge those fix PRs, as it will make it much easier to create a Deno port in the future.
Approach
See this link for the new README that explains the approach:
Demo
The resulting code that is auto-generated by this script can be seen at https://deno.land/x/[email protected] . It should work identically to
neo4j-driver-lite
.Instructions for testing it out are in the README in this PR and also in the README at https://deno.land/x/[email protected]
Known issues
I didn't have time to figure out how to test this driver using the test suite. But the code is 99% the same as the neo4j-driver-lite code (which is tested), it's fully type-checked by TypeScript as part of the build process, and I've been using this in a large Neo4j project (via Vertex Framework) without issues.
Other Thoughts
Thanks for having a nicely structured codebase and keeping the dependencies to a minimum! It made this port relatively easy :)