palantir / conjure-typescript

Conjure generator for TypeScript clients
Apache License 2.0
17 stars 16 forks source link

Generate Functions and other Code Slimming Features #253

Open ericanderson opened 1 year ago

ericanderson commented 1 year ago

Note: This PR is broken into two commits: one for the actual changes and one for a ton of fixture changes. You will likely want to review them separately. The fixture changes will mostly just require skimming.

This change causes all services to generate functions of the format ServiceName_endpointMethodName that take signature of the call method of the bridge AND the remaining args as their ServiceName['endpointMethodName'] counterparts do.

These new functions also leverage a tuple spread for better minification.

This PR further adds command line flags to the generator:

changelog-app[bot] commented 1 year ago

Generate changelog in changelog-dir>`changelog/@unreleased`</changelog-dir

Type

- [ ] Feature - [ ] Improvement - [ ] Fix - [ ] Break - [ ] Deprecation - [ ] Manual task - [ ] Migration

Description

Generate Functions and other Code Slimming Features This change causes all services to generate functions of the format `ServiceName_endpointMethodName` that take signature of the `call` method of the bridge AND the remaining args as their `ServiceName['endpointMethodName']` counterparts do. These new functions also leverage a tuple spread for better minification. This PR further adds command line flags to the generator: * `--omitServiceMetadata` : Instead of generating `"ServiceName", "EndpointName"` as the first to arguments to all bridge calls, this flag will cause empty strings to be passed instead. * `--omitUnnecessaryArgs` : Cause the same size reduction for service class methods that functions get. * `--omitServiceClasses` : Skip generating service classes and interfaces **Check the box to generate changelog(s)** - [ ] Generate changelog entry