-
Notifications
You must be signed in to change notification settings - Fork 26
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
Tom/deparse PR #63
base: 16-latest
Are you sure you want to change the base?
Tom/deparse PR #63
Conversation
Add bindings for pg_query_deparse_protobuf
NOTE: @tomquist I'm thinking how to address 4.8M that proto.js adds, since this is literally bundling C objects already 30M, maybe it's not much add, but I'm going to consider tree-shaking for the deparser |
another thought, once we get the supabase builds in CI/CD, I think we can get rid of those .a and .lib files https://github.com/launchql/libpg-query-node/actions/workflows/build-supabase-artifacts.yml |
I was also thinking instead of supabase builds, could we just publish the binaries to npm? esbuild for example does this and publishes the builds for different os/cpu variants as sub-packages, and then you can tweak your local yarn/npm settings to that only the ones relevant to the architectures your app supports are pulled in. |
Looks like they just add them all as optional dependencies: https://github.com/evanw/esbuild/blob/main/npm/esbuild/package.json |
Then these package.json attributes tell package managers whether they're relevant on the current arch: https://github.com/evanw/esbuild/blob/main/npm/%40esbuild/linux-arm/package.json#L14 And then install.js is generated here, which is run by a postinstall script in the main package: https://github.com/evanw/esbuild/blob/main/npm/esbuild/package.json#L10. That script makes various attempts to resolve the path to the binary here (either by the already-installed optional deps or fetching from/via npm) Anyway the point is that it seems like there's a general path here to publishing as separate packages to npm followed by an install script that resolves the binary path (no need to rely on supabase) |
@benasher44 it's a good idea! I would just need an example of how to fetch from npm cdn without using npm install, is that possible? |
Yep can you see here: https://github.com/evanw/esbuild/blob/886c5456d4edc6094391e9e6fcccb19661621868/lib/npm/node-install.ts#L218 If configured correctly, npm/yarn should automatically get the relevant optional dependencies (based on declared CPU arch, etc.), but if npm/yarn hasn't done that, this method is available to fetch from npm |
#32 is the original PR, working here to clean up protobuf issues