conjure-typescript icon indicating copy to clipboard operation
conjure-typescript copied to clipboard

Generate Functions and other Code Slimming Features

Open ericanderson opened this issue 2 years ago • 1 comments

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:

  • --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

ericanderson avatar Mar 07 '23 16:03 ericanderson

Generate changelog in changelog/@unreleased

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

changelog-app[bot] avatar Mar 07 '23 16:03 changelog-app[bot]