Conversation
Add yyjson as a Git submodule under src/c_src/yyjson.
Decode incoming webview bind request JSON into a Ring list before invoking the Ring callback, and serialize list, number, or string return values to JSON when calling webview_return. BREAKING CHANGE: webview bind callbacks now receive a decoded Ring list instead of the raw JSON request string.
Disable yyjson tests, fuzzer, docs, and install targets, add the subdirectory excluded from all, and link yyjson privately to ring_webview.
Update WebView documentation to explain the bound Ring function signature, automatic JSON decoding of call arguments, and how `wreturn()` resolves JavaScript promises with Ring lists, numbers, or raw JSON strings.
Update the reference and usage guide so bound callbacks are shown receiving a decoded Ring list in `req`. Remove the manual JSON parse examples and clarify that `wreturn()` can take Ring lists, numbers, or raw JSON strings when resolving JavaScript promises.
The C backend now decodes the JS request payload into a Ring list and encodes wreturn() list/number arguments to JSON automatically, so the examples no longer need simplejson for the webview data path. BREAKING CHANGE: bound Ring functions receive `req` as a decoded Ring list instead of a raw JSON string, and wreturn() encodes list/number arguments itself. Code calling json_decode(req) must drop the decode. - req arrives as a decoded Ring list: drop json_decode(req) (52 sites) and the substr(req) bracket-stripping hacks (23, 42, 43) - wreturn() accepts lists/numbers directly: drop json_encode() wrappers (48 sites); split buildStateJSON()/build_notes_json() helpers so they return Ring lists, keeping json_encode only at their evalJS/file-write callers - remove load "simplejson.ring" from 19 files with no remaining JSON use; keep it where examples parse curl/HTTP responses, persist state to files, embed JSON in evalJS, or decode double-encoded JS payloads - 04_callbacks: print req with see (string + list is a runtime error) - 37_weather_app: switch from OpenWeatherMap (dead demo key) to Open-Meteo (free, no key); geocode city via Open-Meteo geocoding API, map WMO weather codes to descriptions/icons, reshape responses to the existing frontend structure
Add src/c_src/ring_webview_json.h to the files list in package.ring so the JSON bridge header is distributed with the package and available to the webview C build.
Move the yyjson subdirectory setup ahead of the webview target configuration and force position-independent code so the vendored library can link into the shared webview extension without relocation errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.