#hey, when is the node client going to be

1 messages · Page 1 of 1 (latest)

void flax
worthy blade
#

Ig it was buf that's on its own registry for some reason

void flax
#

we use buf to generate sdk and it has its own registry. also we have a client generator, with actions we publish to npm registry. when you install both buf one and npm one, you can use it

worthy blade
void flax
#

Could you point out those errors and would love to get your feedback in general.

worthy blade
shy mango
#

Hi @worthy blade, this depends on the version you use. previously your implementation would work, but after integrating buf generated core sdk, we need to create request objects as the error message indicates. Please checkout the example here: https://www.npmjs.com/package/@permify/permify-node

worthy blade
#

ok i see, this is non-standard dx for node/ts based projects. That aside if you're going to go down this route then at least do the typings/error messages correctly.

#

i can appreciate using sdk generators like grpc/swagger but not at the expense of dx, especially on a relatively simple API.

like this makes sense for node/ts:


//zero types but doesn't matter because it's intuitive and in-line with the rest-based sdk
client.schema.write({
    tenantId: "t1",
    schema: `
    entity user {}
    
    entity document {
       relation viewer @user
       
       action view = viewer
    }
    `
});

whereas this doesn't, it looks like some old school java builder pattern. i dont see how any node/ts dev would accept such a downgrade in dx.

let schema = `
    entity user {}
    
    entity document {
       relation viewer @user
       
       action view = viewer
    }
`;

//zero types btw, dev has to care about grpc stuff, not in-line with docs or rest-based sdk - why would i want to use this unless to make my life difficult for zero gain? miniscule perf gain?
let schemaWriteRequest = new permify.grpc.payload.SchemaWriteRequest();
schemaWriteRequest.setTenantId("t1");
schemaWriteRequest.setSchema(schema);

client.schema.write(schemaWriteRequest);

hopefully some better decisions can be made going forward to make things simpler and easier instead of complicating things for no gain.

shy mango
#

Hi @worthy blade,

We use gRPC SDK generators to standardize client generation to make the clients error prone for further updates on our core.

Thank you for the feedback. I understand your concerns with this change and will consider a better solution. This new approach is intended only for payloads and responses. Perhaps we can develop a wrapper to accommodate both methods.

I will discuss this with the team and circle back to you in a couple of days.

shy mango
#

Hi @worthy blade, we will update the Node client shortly to improve the developer experience as you mentioned. I will inform the community shortly.