Skip to content

Commit

Permalink
Utilize Bindgen opt-in list (#5820)
Browse files Browse the repository at this point in the history
* Handle opt-in methods and fields in the templates.

* Add initial opt-in list.

* Add 'opt-in' option to CMakeLists and package.json.

* Add remaining items in opt-in list.

* Invoke 'BoundSpec.applyOptInList()'.

* Add opt-in list path to 'files' in 'package.json'.

* Remove unused items from opt-in list.

* Update deprecation comments to be more specific.

* Point Core submodule to new commit.

* Update formatting in comments.

* Apply yaml file validation.

* Update comments.

* Revert 'Apply yaml file validation'.

We'll instead have the binding generator generate the opt-in spec schema file from spec.yaml in order to list all classes and records with their corresponding methods and fields. The validation would then also provide autocomplete in the opt-in spec file. (Will be done in bindgen.)

* Update Core pointer.

* Update opt-in list to reflect latest changes to the Core spec.

* Update Core pointer.

* Add 'is_fulltext_indexed' to opt-in list.

* Add CHANGELOG entry.
  • Loading branch information
elle-j authored Jun 19, 2023
1 parent 7d845a2 commit f1489ab
Show file tree
Hide file tree
Showing 10 changed files with 575 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* Aligning analytics with other Realm SDKs. You can still disable the submission by setting environment variable `REALM_DISABLE_ANALYTICS`, and you can print out what is submitted by setting the environment variable `REALM_PRINT_ANALYTICS`.
* Disabling sync session multiplexing by default in the SDK, since Core's default changed to enabled with v13.11.0. ([#5831](https://github.com/realm/realm-js/pull/5831))
* Upgraded Realm Core from v13.11.1 to v13.13.0. ([#5873](https://github.com/realm/realm-js/pull/5873))
* Applied use of an opt-in list for Bindgen. ([#5820](https://github.com/realm/realm-js/pull/5820))

## 12.0.0-alpha.2 (2023-04-05)

Expand Down
5 changes: 5 additions & 0 deletions packages/realm/bindgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ file(GLOB_RECURSE SDK_TS_FILES
list(FILTER SDK_TS_FILES EXCLUDE REGEX "templates/[^/]*\.ts$")

set(JS_SPEC_FILE ${SDK_DIR}/bindgen/js_spec.yml)
set(JS_OPT_IN_FILE ${SDK_DIR}/bindgen/js_opt_in_spec.yml)
set(TYPESCRIPT_OUTPUT_DIR ${SDK_DIR}/generated/ts)

set(GENERATED_TS_FILES
Expand All @@ -136,6 +137,7 @@ bindgen(
OUTPUTS ${GENERATED_TS_FILES}
OUTDIR ${TYPESCRIPT_OUTPUT_DIR}
SPECS ${JS_SPEC_FILE}
OPTIN ${JS_OPT_IN_FILE}
SOURCES ${SDK_TS_FILES}
)

Expand All @@ -148,6 +150,7 @@ bindgen(
OUTPUTS ${GENERATED_JS_FILES}
OUTDIR ${TYPESCRIPT_OUTPUT_DIR}
SPECS ${JS_SPEC_FILE}
OPTIN ${JS_OPT_IN_FILE}
SOURCES ${SDK_TS_FILES}
)

Expand All @@ -161,6 +164,7 @@ if(DEFINED CMAKE_JS_VERSION)
OUTPUTS node_init.cpp
OUTDIR ${CMAKE_CURRENT_BINARY_DIR}
SPECS ${JS_SPEC_FILE}
OPTIN ${JS_OPT_IN_FILE}
SOURCES ${SDK_TS_FILES}
)

Expand All @@ -173,6 +177,7 @@ else()
OUTPUTS jsi_init.cpp
OUTDIR ${CMAKE_CURRENT_BINARY_DIR}
SPECS ${JS_SPEC_FILE}
OPTIN ${JS_OPT_IN_FILE}
SOURCES ${SDK_TS_FILES}
)

Expand Down
Loading

0 comments on commit f1489ab

Please sign in to comment.