Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fixed-size array in Javascript #5864

Closed
stephanemagnenat opened this issue Apr 20, 2020 · 10 comments
Closed

Add support for fixed-size array in Javascript #5864

stephanemagnenat opened this issue Apr 20, 2020 · 10 comments
Labels

Comments

@stephanemagnenat
Copy link

Using git master on April 20, 2020 (cb4d0f7) it seems fixed-size array is not supported in Javascript or Typescript. As the binary representation of the fixed-size array is equivalent of the unrolled version, I do not see any theoretical reason why there is no Javascript support, in the worst case with something like var0...varN naming. Indeed, in the use case where Flatbuffers is used to exchange data between Javascript and Rust/C++, it would be nice to be able to enjoy the fixed-size array on the Rust/C++ side.

@aardappel
Copy link
Collaborator

Yup, there is no reason it can't be supported, other than that no-one has taken the time to do it.
PRs welcome!

@github-actions
Copy link

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Oct 19, 2020
@stephanemagnenat
Copy link
Author

Please do not close, it is still a useful feature to consider...

@github-actions github-actions bot removed the stale label Oct 20, 2020
@anassinator
Copy link
Contributor

@stephanemagnenat @evanw @evolutional @krojew @bjornharrtell Is this something any of you are considering tackling any time soon?

@krojew
Copy link
Contributor

krojew commented Nov 4, 2020

Yes, but no idea when.

@github-actions
Copy link

github-actions bot commented May 5, 2021

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

@TheButlah
Copy link

I believe this should be reopened

@aardappel aardappel reopened this Mar 24, 2022
@github-actions github-actions bot removed the stale label Mar 24, 2022
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 10, 2022
…google#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to schema
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 10, 2022
…google#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to schema
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 12, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
@mehmetb
Copy link

mehmetb commented Oct 12, 2022

There is a new PR for this feature: #7581

bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 18, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 18, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 19, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 19, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 21, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 21, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 21, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 21, 2022
…oogle#7021)

* Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

* Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

* Supports the both standard API and Object Based API.

* Added a test.

Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 21, 2022
…oogle#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 26, 2022
…oogle#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 27, 2022
…oogle#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 27, 2022
…oogle#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 27, 2022
…oogle#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
bulentv added a commit to zdrealityhub/flatbuffers that referenced this issue Oct 27, 2022
…oogle#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
dbaileychess pushed a commit that referenced this issue Oct 29, 2022
#7581)

* [TS] Add support for fixed length arrays on Typescript (#5864) (#7021)

    * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility.

    * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema.

    * Supports the both standard API and Object Based API.

    * Added a test.

    Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv>
    Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>

* Formatting & readability fixes on idl_gen_ts.cpp

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>

* Added array_test_complex.bfbs

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>

* TS arrays_test_complex: Remove bfbs and use  fbs directly

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>

Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
@github-actions
Copy link

This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Apr 13, 2023
@stephanemagnenat
Copy link
Author

This seems to be fixed by the linked PR, that is merged. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants