gristlabs_grist-core/buildtools
Alex Hall 9fffb491f9 (core) External requests
Summary:
Adds a Python function `REQUEST` which makes an HTTP GET request. Behind the scenes it:

- Raises a special exception to stop trying to evaluate the current cell and just keep the existing value.
- Notes the request arguments which will be returned by `apply_user_actions`.
- Makes the actual request in NodeJS, which sends back the raw response data in a new action `RespondToRequests` which reevaluates the cell(s) that made the request.
- Wraps the response data in a class which mimics the `Response` class of the `requests` library.

In certain cases, this asynchronous flow doesn't work and the sandbox will instead synchronously call an exported JS method:

- When reevaluating a single cell to get a formula error, the request is made synchronously.
- When a formula makes multiple requests, the earlier responses are retrieved synchronously from files which store responses as long as needed to complete evaluating formulas. See https://grist.slack.com/archives/CL1LQ8AT0/p1653399747810139

Test Plan: Added Python and nbrowser tests.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: paulfitz, dsagal

Differential Revision: https://phab.getgrist.com/D3429
2022-06-17 21:53:20 +02:00
..
build.sh (core) add machinery for self-managed flavor of Grist 2022-05-12 12:39:52 -04:00
generate_locale_list.js (core) Extending default locale list 2021-09-24 15:10:13 +02:00
prepare_python2.sh Use /usr/bin/env instead of /bin/bash 2022-03-08 19:24:36 +00:00
prepare_python3.sh Use /usr/bin/env instead of /bin/bash 2022-03-08 19:24:36 +00:00
prepare_python.sh Use /usr/bin/env instead of /bin/bash 2022-03-08 19:24:36 +00:00
tsconfig-base-ext.json (core) add machinery for self-managed flavor of Grist 2022-05-12 12:39:52 -04:00
tsconfig-base.json (core) External requests 2022-06-17 21:53:20 +02:00
webpack.check.js (core) fix browser check and favicon in grist-core 2022-01-05 18:15:05 -05:00
webpack.config.js (core) add machinery for self-managed flavor of Grist 2022-05-12 12:39:52 -04:00