pulumi/pkg/codegen/nodejs
Fraser Waters c7ed4024ff Support for integers on the wire and state protocol
An exploration into how we could support int64 as well as float64 as a
first class type in Pulumi.

There's some inherit trickiness with this because we use JSON in a few
places, state files most obviously but `PropertyValue` on the wire is
using the protobuf `Struct` and `Value` types which are just mappings to
JSON as well.

JSON doesn't have an int64 type, and while the Go JSON marshaller can
read/write int64s it's not a great behaviour to rely on given mixed
support for that across languages. Further the protobuf `Value` type
only supports float64s.

So we support integers similar to our other special types (like assets)
and wrap them in an object with a special signature field. The value
itself is either a number (if it can safely roundtrip to float64 and
back again) or a string.

Providers, SDKs and the engine communicate support for integers via
`AcceptsIntegers` fields in their interfaces (or similar). When
transmitting to a peer that doesn't support integers (e.g. an old SDK,
or old provider) all integer values are mapped back to standard number
values.

As this changes the serialisation of property values in the state file
it will trigger errors if old engines try to load a state file
containing integers.
2024-08-23 13:36:45 +01:00
..
gen_program_test Use `assert.NoError` rather than `assert.Nil` (#14233) 2023-10-13 09:46:07 +00:00
tstypes turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
doc.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
doc_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
gen_fileinfo.go [codegen/node] Implement support for lazy-loaded Node modules (#10538) 2022-09-01 18:42:44 -04:00
gen_intrinsics.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
gen_lazyloads.go pkg/codegen/nodejs: Prefer contract.Assertf over Assert 2023-03-01 13:22:32 -08:00
gen_lazyloads_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen_program.go Add support for `DeletedWith` to `pulumi convert` (#12011) 2024-07-19 14:17:45 +00:00
gen_program_expressions.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
gen_program_lower.go Fixes parseProxyApply to handle nested outputs within index expressions 2023-08-07 21:08:54 +02:00
gen_program_test.go Run conformance tests with and without ts-node (#15809) 2024-03-28 15:44:25 +00:00
gen_program_utils.go [program-gen] Fix generated utility functions for filebase64, filebase64sha256, sha1 and mimeType (#14857) 2023-12-15 11:26:00 +00:00
gen_test.go Add NodeJS test for parameterized providers #2 (#16901) 2024-08-09 08:34:29 +00:00
importer.go Remove 'pluginVersion' and 'pluginName' from nodejs schema options. 2023-08-08 12:19:06 +01:00
test.go use yarn less in nodejs codegen tests (#15886) 2024-04-09 16:56:05 +00:00
utilities.go pkg/codegen/nodejs: Prefer contract.Assertf over Assert 2023-03-01 13:22:32 -08:00
utilities.ts Support returning plain values from methods (#13592) 2023-11-18 06:02:06 +00:00
utilities_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00