Commit Graph

12 Commits

Author SHA1 Message Date
José Luis Millán aa6848fbf6
TS/JS: Use TypeError instead of Error when appropriate (#7910)
Ie: when the needed conditions are not satisfied in order to perform a
 given action.
2023-04-25 22:22:06 -07:00
José Luis Millán b17d59b18c
[TS]: builder, Fix requiredField(). Verity that the field is present in the vtable (#7739) (#7752)
* [TS]: Fix vtable creation for consecutive required fileds (#7739)

* handle feedback

* comment the schema

* comment change in builder.ts

* [TS]: builder, Fix requiredField()

Verifty that the field is present in the vtable.

* restore monsterdata binary file

Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-10 10:43:17 -08:00
Björn Harrtell d243b904cc
[TS] Make strict compliant and improve typings (#7549)
* [TS] Make strict compliant and improve typings

* clang-format

* Code gen harmonize

Co-authored-by: Derek Bailey <derekbailey@google.com>
2022-09-29 15:03:35 -07:00
Derek Bailey b86387442e
Fix typos (#7483) 2022-08-26 14:35:21 -07:00
Björn Harrtell 950444a343
[TS] Use TextEncoder and TextDecoder (#7400)
* [TS] Use TextEncoder

TextEncoder is well supported these days, see https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#browser_compatibility.

* Reuse instance

* Also use TextDecoder

* Forgot to add text_decoder_ member

Co-authored-by: Derek Bailey <derekbailey@google.com>
2022-08-06 22:00:30 +00:00
sssooonnnggg 987bebe678
[TS] fix incorrect reverse when writting array of structs (#7271) 2022-08-05 22:00:16 -07:00
Timo Sturm e910bddbcc
[JS] Add ".js" suffix to all import statements to generate a browser compatible mjs version. (#7086) 2022-02-08 12:21:20 -08:00
Max Burke 5993338ee3
[ts] Builder incorrectly serializing empty strings (#7047)
* [ts] Builder incorrectly serializing empty strings

The builder was returning an offset of zero for empty strings. This is
leading to flatbuffers which fail verification in other languages, such
as Rust.

* tests expect 0 offset for null or undefined strings
2022-01-29 14:23:57 -08:00
Alex E ace4a37f22
[TS/JS] BigInt implementation (#6998)
* BigInt implementation

* Unit test reading long from existing bytebuffer

* Code review
2022-01-06 20:35:37 -06:00
Björn Harrtell 760c657551
[TS/JS] New gen TS code gen (#6302)
* TS/ES6 modules spike iteration 1

* Initial modularized dasherized output

* Remove obsoleted parts and namespace wrapping

* Use _flatbuffers_ prefix

* First part of imports logic

* Second part of imports logic

* Fix TS/JS code removal mixup

* Alias imported symbols if same name from different namespaces and some fixes

* Use star import for bare imports

* Fix messed up string concat

* var to const and remove not needed semi

* Remove some cases of ns prefixing

* Add missing space

* Cleanups

* Completed initial import tracking logic

* Compilable output

* Adjust TypeScriptTest and dependents to work

* Use local flatbuffers package for tests

* Refactor away use of any

* Remove obsolete imported_fileset and reexport_map

* Still need any and fix JavaScriptTest.sh

* Fix test runs out of the box

* Temp add generated files

* TypeScriptTest replaces JavaScriptTest and cleanups

* Also remove reference to JavaScriptTest in TestAll.sh

* Remove old generated ts/js files

* Remove use of --js in generate_code scripts

* idl_gen_js_ts to idl_gen_ts and removal of js gen

* Remove obsoleted options

* Fix obsolete ts test detection

* Tweak ts compilation be as strict as possible

* Remove jsdoc type annotation generation

* Generated test ts files

* Fix search and replace messup

* Regenerated ts test output

* Use CharToLower

* Use normal for loop

* Rework namespacedir

* Revert "Rework namespacedir"

This reverts commit 6f4eb0104ceeb86011bb076ebca901138c48e068.

* Revert "Use normal for loop"

This reverts commit 676b2135bfaa1853dfbb06c92b5c16a0d81bb13a.

* Revert "Use CharToLower"

This reverts commit 2d08648d0d72d0af201fad80d54cdc76412b35e9.

* Again do rework but correct

* Avoid runtime cast

* Fix test runs

* Also add npm install to get tsc

* Bump node test versions

* for range to std for loop

* Clang format

* Missed one clang format

* Move accessor to later

* Attempt to make windows version of TypeScriptTest

* Want to see the output

* Try to get newer node at appveyor

* Style changes
2021-01-19 12:51:13 -08:00
James Kuszmaul faeb04fbe1
Add type annotation to unspecified array (#6264)
The lack of any type on the `ret` variable was causing our typescript compiler to complain.
2020-11-16 10:49:53 -08:00
Björn Harrtell 94873e595c
[JS/TS] Modernize TypeScript / JavaScript flatbuffers support (#6095) 2020-09-17 12:21:14 -07:00