170 Commits

Author SHA1 Message Date
mustiikhalil
e6bbb3d22e [Swift] Migrate to swift 6.0 and Implements support gRPC v2 (#8983)
* Migrate to swift 6.0 & swift-gRPC 2.0

The following migrates to swift 6.0, and also
migrate to swift-grpc 2.0 that uses swift-nio
under the hood to provide nicer API and async await

Adds sendable to enum & update @_implementationOnly imports to use internal imports

* Address PR comments regarding misspelling & proper method naming.
2026-05-06 04:39:53 +02:00
Felix
e223d69b36 [Python] Extend GRPC Typing (#9007)
Extend function calls with optional type infos for checking
and discovering.

e838ba8a71/src/python/grpcio/grpc/__init__.py (L680)
2026-04-03 14:12:08 +00:00
mustiikhalil
fcf75449b8 [Swift] Moves VTs from enums to structs to prevent empty enum generation
Moves VTs from enums to structs to prevent empty enum generation, which would usually cause a compilation error.
2026-02-12 08:04:26 -10:00
Derek Bailey
7e163021e5 FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
Derek Bailey
fb55e0c9de Run clang-format -i **/*.cpp (#8865) 2025-12-19 10:42:57 -08:00
Justin Davis
a1e125af11 Implement --file-names-only (#8788)
* flatc builds and seems to work, some of the extra targets are having linker errors

* fix build system

* pipeline failures

* un-rename files

* refactor to use unique_ptr

* typo

* rm make_unique, add comments

* fix cmake

---------

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-12-03 04:37:06 +00:00
mustiikhalil
7150dfb5c4 [Swift] Bump minimum supported version of swift to 5.10 (#8758) 2025-11-14 15:07:49 -08:00
mustiikhalil
5fe90a9160 [Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift

Implements FlatbuffersVector which confirms to RandomAccessCollection,
this would give us semi-native sugary syntax to all the arrays in swift port.

This work will also be the foundation of using arrays in swift

* Fix failing tests for Swift
2025-11-04 23:53:59 +00:00
Daniel Nguyen
27325e002a docs: clean up whitespace and fix typo in tutorial.md (#8695)
* docs: remove trailing whitespace

* docs: fix typo in tutorial.md
2025-09-25 09:02:22 -07:00
Derek Bailey
1872409707 FlatBuffers Version 25.9.23 (#8708) 2025-09-23 22:18:02 -07:00
Derek Bailey
caf3b494db bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
Derek Bailey
0e047869da Use the Google Style for clang-format without exceptions (#8706)
This reduces the friction when merging from github and google repos by
using the exact same clang style guide.

MARKDOWN=true
2025-09-23 21:19:33 -07:00
Shashank
deb3d93454 gRPC callbackService support added (#8666)
* grpc callbackService support added

Signed-off-by: shankeleven <shashanksati11@gmail.com>

* tests: regenerate C++ gRPC golden with --grpc-callback-api (CallbackService & async_ reactor APIs); update formatting and method placement

---------

Signed-off-by: shankeleven <shashanksati11@gmail.com>
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
2025-08-28 15:49:27 -07:00
mustiikhalil
07c2eb5fe7 Moves away from @_exported import to add the import in the generated code (#8637) 2025-07-16 12:07:08 -07:00
mustiikhalil
b8db3a9a6a Adds windows swift support (#8622)
Adding support for windows requires the code generations
to add a compiler statement to completely ignore GRPC code
generation on windows

Cleanup the project to use the main Package.swift to run tests
instead of having it separate and includes the imports for GRPC
within it.

Adds windows swift ci
2025-06-30 05:45:48 -07:00
Felix
31beb0fb2f Bugfix: grpc python code generation location and file suffix (#8359)
* clang-format

* [Python] Replace . with _ in grpc filename suffix

Having filenames with . like `file.fb.grcp`
is not great for Python. Since dots are used for namespaces.
Replacing all of them with _ eg suffix `foo.bar.baz` will become
`foo_bar_baz`.

Restoring the previous default `_fb` suffix.

* [Python] Use namespace in path

This fixes a regression introduced with:
fb9afbafc7
And generates the grpc file in the namespace folder again.

* Sync commandline docs with web docs
2025-06-24 22:52:40 -07:00
mustiikhalil
5a95b7b6bc [Swift] Flexbuffers native swift port (#8577)
* Offical Swift port for FlexBuffers

This is the offical port for FlexBuffers within
swift, and it introcudes a Common Module where code
is shared between flatbuffers and flexbuffers.

Writing most supported values like maps, vectors,
nil and scalars into a flexbuffer buffer. And includes
tests to verify that its similar to cpp

* Reading a flexbuffer

Implementing reading from a flexbuffer, enabling
most of the buffers features, like most types, maps, vectors,
typedvectors, and fixedtypedvectors.

Currently, if an offset/object cant be read we default to a swift
nil instead of the default flexbuffers 'null' with all values.

* Fixes bazel breaking due to new project structure

Address warnings within the library

* Adds comment on why we added the code & properly enforce the amout of bytes needed
2025-06-22 08:36:38 +02:00
mustiikhalil
bd1b2d0baf [Swift] Adds new API to reduce memory copying within swift (#8484)
* Adds new API to reduce memory copying within swift

Adds new storage container _InternalByteBuffer which
will be holding the data that will be created within the swift
lib, however reading data will be redirected to ByteBuffer, which
should be able to handle all types of data that swift provide without
the need to copy the data itself. This is due to holding a reference to
the data.

Replaces assumingMemoryBinding with bindMemory which is safer

Adds function that provides access to a UnsafeBufferPointer for
scalars and NativeStructs within swift

Updates docs

Suppress compilation warnings by replacing var with let

Using overflow operators within swift to improve performance

Adds tests for GRPC message creation from a retained _InternalByteBuffer
2025-03-18 07:48:39 +01:00
Derek Bailey
1c514626e8 FlatBuffers Version 25.2.10 2025-02-10 20:25:03 -08:00
mustiikhalil
c49e81d6ec Adds swift 6 to the build matrix (#8414)
Bump min version of swift to be 5.9
2025-02-04 09:11:46 -08:00
Derek Bailey
0312061985 FlatBuffers Version 25.1.24 2025-01-24 16:36:11 -08:00
Derek Bailey
df287ee6a7 FlatBuffers Version 25.1.21 2025-01-21 17:22:30 -08:00
Derek Bailey
5414e04b45 Add imports for bazel (#8486) 2025-01-15 09:24:34 -08:00
Derek Bailey
a2cd1ea3b6 FlatBuffers Version 24.12.23 (#8459)
* FlatBuffers Release 24.12.23

* Fixed missing generated file version checks

* Run generate_code and fix cpp17 tests
2024-12-23 12:55:07 -08:00
Mikhail
2f59a0319b Update grpc-core version (#8412)
* Update grpc-core version

io.grpc:grpc-core package in version 1.36.0 contains multiple [CVE's](https://mvnrepository.com/artifact/io.grpc/grpc-core/1.36.0).
Bump grpc-core version to latest 1.68.0 version to mitigate potential vulnerabilities.

* Update grpc version to 1.67.1

grpc was mistakenly released to maven under version 1.68.0 whenever a real release was done for version 1.67.1 [1]. The mistake was fixed later.

[1] https://github.com/grpc/grpc-java/releases
2024-10-05 18:24:05 -07:00
Anton Bobukh
fb9afbafc7 [gRPC] Update the code generator for Python to produce typed handlers (#8326)
* Move `namer.h` and `idl_namer.h` to `include/codegen` so they can be reused from `grpc` dirqectory.

* [gRPC] Update the Python generator to produce typed handlers and Python stubs if requested.

* [gRPC] Document the newly added compiler flags.
2024-06-18 16:02:57 -07:00
mustiikhalil
75f05d6389 Sets Swift minimum version to 5.8 (#8228)
Updates copyright from 2023 to 2024 & formats code - updates formatting rules

Updates CI to run with swift 5.8

Adds wasmer & updates command to run carton as a swift plugin

Update bazelci to also accept swift 5.8

Adds swift 5.10 to the test matrix
2024-05-29 13:07:54 -07:00
mustiikhalil
a41fefa1a8 Trying to fix bazel on macOS and Xcode 14.3 (#8304)
* Fixes Bazel issues for windows and ci

Fetching boringssl within the flatbuffers repository, to patch the issues
of not being able to upgrade to Xcode 14.3 due to buildkite throwing
errors. The patch was inspired by the tenserflow patch
https://github.com/tensorflow/tensorflow/issues/60191#issuecomment-1496073147

Removes references of swift from the windows pipeline for bazel

Sets github actions to use xcode 14.3 for kotlin and sets the macOS
build for intel cpus.

* Update build.yml

Remove comment that is not relevant any longer.

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
2024-05-28 17:29:41 -07:00
Anton Bobukh
150644d7f4 [gRPC] Add new options to control the gRPC code generation. (#8298)
The new options are:

-  `--grpc-filename-suffix` controls the suffix of the generated files;
-  `--grpc-use-system-headers` controls the type of C++ includes generated;
-  `--grpc-search-path` controls the directory that contains gRPC runtime;
-  `--grpc-additional-header` allows to provide additional dependencies for the generated code.
2024-05-15 08:17:40 -07:00
Derek Bailey
595bf0007a FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
Derek Bailey
6ff9e90e7e FlatBuffers Version v24.3.7 2024-03-07 15:16:33 -08:00
Derek Bailey
7cd216c51e FlatBuffers Version v24.3.6 2024-03-07 06:52:51 +00:00
dependabot[bot]
91a3172519 Bump google.golang.org/grpc in /grpc/examples/go/greeter/client (#8131)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-18 12:12:44 -08:00
dependabot[bot]
e0d4562782 Bump google.golang.org/grpc in /grpc/examples/go/greeter/server (#8132)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-18 12:12:16 -08:00
dependabot[bot]
49677b0b70 Bump google.golang.org/grpc in /grpc/examples/go/greeter/models (#8130)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-18 12:11:35 -08:00
dependabot[bot]
0def91105f Bump google.golang.org/grpc in /grpc/examples/go/greeter/models (#8025)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.35.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.35.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Le <michael.le647@gmail.com>
2023-09-21 20:41:18 +00:00
dependabot[bot]
8176a204fc Bump google.golang.org/grpc in /grpc/examples/go/greeter/client (#8026)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.35.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.35.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Le <michael.le647@gmail.com>
2023-09-20 22:04:44 -04:00
dependabot[bot]
5d4386b1bc Bump google.golang.org/grpc in /grpc/examples/go/greeter/server (#8027)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.39.0-dev to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.39.0-dev...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Le <michael.le647@gmail.com>
2023-09-20 23:27:39 +00:00
OptoCloud
48da238920 Make eslint less pedantic (#8012)
* Disable eslint spam

* Generate TS example files
2023-07-10 15:48:16 +00:00
Derek Bailey
0100f6a577 FlatBuffers Version 23.5.26 (#7976) 2023-05-26 10:33:09 -07:00
Chih-Hsuan Yen
a352bdbc34 Fix python tests (#7960)
* Don't generate types unless --python-typing specified

Fixes https://github.com/google/flatbuffers/issues/7944

* Fix incorrect import statements

Fixes https://github.com/google/flatbuffers/issues/7951

* Fix $PYTHONPATH in PythonTest.sh

Regressed from https://github.com/google/flatbuffers/pull/7529

* PythonTest: fail if something goes wrong

GitHub Actions runs `bash PythonTest.sh`, and thus failures were not
visible.

* Build flatc for Python tests

* Regenerate codes

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-05-17 13:10:51 -07:00
Derek Bailey
72b56fd081 FlatBuffers Version 23.5.9 (#7945) 2023-05-09 09:33:30 -07:00
RishabhDeep Singh
13fc75cb6b FlatBuffers Version 23.5.8 (#7943) 2023-05-09 08:05:25 -07:00
Philipp Schrader
c1e7aee489 Migrate from rules_nodejs to rules_js/rules_ts (take 2) (#7928)
* Migrate from rules_nodejs to rules_js/rules_ts (take 2)

This is the second version of patch #7923. The first version got
reverted because bazel query was failing:

    $ bazel --nosystem_rc --nohome_rc query tests(set('//...')) except tests(attr("tags", "manual", set('//...')))
    ERROR: Traceback (most recent call last):
    	File "/workdir/tests/ts/bazel_repository_test_dir/BUILD", line 6, column 22, in <toplevel>
    		npm_link_all_packages(name = "node_modules")
    	File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/npm/defs.bzl", line 188, column 13, in npm_link_all_packages
    		fail(msg)
    Error in fail: The npm_link_all_packages() macro loaded from @npm//:defs.bzl and called in bazel package 'tests/ts/bazel_repository_test_dir' may only be called in bazel packages that correspond to the pnpm root package '' and pnpm workspace projects ''

This was happening because the `.bazelrc` file only added
`--deleted_packages` to the `build` command. We also need it for the
`query` command. This second version of the patch fixes that.

Original commit message:

This patch migrates the current use of rules_nodejs to the new rules_js.
rules_js is the intended replacement of rules_nodejs as per this note:
https://github.com/aspect-build/rules_js#relationship-to-rules_nodejs

> rules_js is an alternative to the build_bazel_rules_nodejs Bazel module
> and accompanying npm packages hosted in
> https://github.com/bazelbuild/rules_nodejs, which is now
> unmaintained. All users are recommended to use rules_js instead.

There are a few notable changes in this patch:
1. The `flatbuffer_ts_library` macro no longer accepts a `package_name`
   attribute. This is because rules_js appears to manage the import
   naming of dependencies via top-level `npm_link_package` targets.
   Users will have to migrate.
2. I added a few more arguments to `flatbuffer_library_public()`. These
   helped with exposing esbuild to `ts/compile_flat_file.sh`.
3. I pinned the version of `typescript` in `package.json` so that
   rules_ts can download the exact same version. rules_ts doesn't know
   what to do if the version isn't exact.
4. Since rules_js uses the pnpm locking mechanism, we now have a
   `pnpm-lock.yaml` file instead of a yarn lock file.
4. I added bazel targets for a few of the existing tests in `tests/ts`.
   They can be run with `bazel test //test/ts:all`. Since there is no
   flexbuffers bazel target, I did not add a bazel target for the
   corresponding test.
5. I added a separate workspace in `tests/ts/bazel_repository_test_dir/`
   to validate that the flatbuffers code can be imported as an external
   repository. You can run the test with
   `bazel test //test/ts:bazel_repository_test`. For this to work, I
   needed to expose a non-trivial chunk of the flatbuffers code to the
   test. I achieved this through some recursive `distribution`
   filegroups. This is inspired by rules_python's workspace tests.

I did not do anything special to validate that the `gen_reflections`
parameter works the same. This patch doesn't change anything about
the TypeScript generation.

As a side note: I am not an expert with rules_js. This patch is my
attempt based on my limited understanding of the rule set.

Fixes #7817

* Fix the query

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-05-03 11:48:15 -07:00
Derek Bailey
e7dc252b0e Revert "Migrate from rules_nodejs to rules_js/rules_ts (#7923)" (#7927)
This reverts commit 4172c3f0bd.
2023-04-28 12:58:49 -07:00
Philipp Schrader
4172c3f0bd Migrate from rules_nodejs to rules_js/rules_ts (#7923)
* Start using pnpm

* Add @npm

* get more stuff set up

* Get the analysis phase passing.

* Get esbuild working?

* Get it compiling?

    $ bazel build //tests/ts/...

* Try to get the test working

* test is passing

* Get the other tests working

* clarify comment

* clean up a bit

* Try to add another test

* Add another test

* clean up more

* remove unused reference

* Add e2e test

* Get more of the test working

* add lock file

* Get test working on its own

* Get e2e test passing

* fix infinite recursion

* Add comments

* clean up some more

* clean up more again

* Source typescript version from package.json

* run buildifier

* lint

* Fix unset `extra_env`

* Incorporate feedback

* run buildifier

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-04-28 18:17:45 +00:00
Max Burke
a397dd7e8c Optionally generate Python type annotations (#7858)
* optionally generate type prefixes and suffixes for python code

* fix codegen error when qualified name is empty

* WIP: Python typing

* more progress towards python typing

* Further iterate on Python generated code typing

* clang-format

* Regenerate code

* add documentation for Python type annotations option

* generate code with Python type annotations

* handle forward references

* clang-format
2023-04-28 09:38:29 -07:00
Jeroen Demeyer
63495b935a Support file_identifier in Go (#7904)
Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-04-26 05:15:09 +00:00
Max Burke
56ecc1f548 Optionally generate type prefixes and suffixes for python code (#7857)
* optionally generate type prefixes and suffixes for python code

* fix codegen error when qualified name is empty

* generated code updated
2023-04-25 21:38:16 -07:00
Derek Bailey
01834de25e FlatBuffers Version 23.3.3 (#7852) 2023-03-03 11:46:55 -08:00