Go to file
Damien Elmes 6941bccde4 Add support for proto3 optional scalars
Protobuf 3.15 introduced support for marking scalar fields like
uint32 as optional, and all of our tooling appears to support it
now. This allows us to use simple optional/null checks in our Rust/
TypeScript code, without having to resort to an inner message.

I had to apply a minor patch to protobufjs to get this working with
the json-module output; this has also been submitted upstream:
https://github.com/protobufjs/protobuf.js/pull/1693

I've modified CardStatsResponse as an example of the new syntax.

One thing to note: while the Rust and TypeScript bindings use optional/
null fields, as that is the norm in those languages, Google's Python
bindings are not very Pythonic. Referencing an optional field that is
missing will yield the default value, and a separate HasField() call
is required, eg:

```
>>> from anki.stats_pb2 import CardStatsResponse as R
... msg = R.FromString(b"")
... print(msg.first_review)
... print(msg.HasField("first_review"))
0
False
```
2022-02-27 19:42:06 +10:00
.buildkite Automatically clean up stale files on TS build error 2022-02-25 12:25:55 +10:00
.github/ISSUE_TEMPLATE update bug report template 2021-11-12 12:20:02 +10:00
.vscode add some more suggested VS Code extensions 2022-02-18 11:33:54 +10:00
cargo Update Rust deps; pin Tokio 2022-02-25 17:10:47 +10:00
docs Automatically clean up stale files on TS build error 2022-02-25 12:25:55 +10:00
ftl Tweak ftl:sync paths 2022-02-25 17:24:52 +10:00
platforms use x86 binaries for clang format/protobuf on Mac 2021-10-16 18:07:39 +10:00
proto Add support for proto3 optional scalars 2022-02-27 19:42:06 +10:00
pylib Update Rust deps; pin Tokio 2022-02-25 17:10:47 +10:00
python Update Python deps, including stable Black 2022-02-25 15:26:16 +10:00
qt Update Python deps, including stable Black 2022-02-25 15:26:16 +10:00
rslib Add support for proto3 optional scalars 2022-02-27 19:42:06 +10:00
sass Show buried until daily limits in overview screen (#1664) 2022-02-14 18:57:01 +10:00
tools Automatically clean up stale files on TS build error 2022-02-25 12:25:55 +10:00
ts Add support for proto3 optional scalars 2022-02-27 19:42:06 +10:00
.bazelignore updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.bazelrc updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.bazelversion updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.prettierignore Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
.prettierrc Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
.user.bazelrc move Bazel convenience symlinks outside of repo folder 2022-01-23 19:18:44 +10:00
BUILD.bazel updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
Cargo.lock Update Rust deps; pin Tokio 2022-02-25 17:10:47 +10:00
Cargo.toml updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
CONTRIBUTORS Match deck name truncation behavior to prevent long deck names from obscuring stats (#1686) 2022-02-24 10:15:26 +10:00
defs.bzl Update rules_nodejs 2022-02-25 16:19:26 +10:00
late_deps.bzl download wheels using rules_python 2021-10-15 16:02:26 +10:00
LICENSE move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
package.json Update to Jest 28 alpha 2022-02-25 16:20:50 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
pyrightconfig.json updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
README.md fix build badge 2021-06-24 09:21:56 +10:00
repos.bzl Update translations 2022-02-25 17:24:53 +10:00
run get PyQt working directly with ./run on macOS 2021-10-16 18:07:29 +10:00
run.bat updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
SECURITY.md add SECURITY.md 2021-09-22 22:55:19 +10:00
WORKSPACE move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
yarn.lock Update to Jest 28 alpha 2022-02-25 16:20:50 +10:00

Anki

Build status

This repo contains the source code for the computer version of Anki.

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see https://betas.ankiweb.net/

For more information on building, please see Development.