Commit Graph

73 Commits

Author SHA1 Message Date
Henrik Giesel
eb4550d2d5 Catch hook errors in two ways:
- try/catch for catching synchronous errors
- Promise.allSettled will allow for rejected promises without fast-failing other promises
2021-07-19 01:23:41 +02:00
Damien Elmes
033856c422 expose _queueAction
https://github.com/ankitects/anki/pull/1292#issuecomment-881795577
2021-07-17 12:12:07 +10:00
Damien Elmes
1209cd115a css_browser_selector was logging to the console 2021-07-17 09:25:05 +10:00
Damien Elmes
4861495b49 keep _updateQA exposed for now, as some add-ons use it 2021-07-17 09:11:05 +10:00
Henrik Giesel
1c1181b9e0 Allow any in reviewer/index.ts 2021-07-16 17:28:31 +02:00
Henrik Giesel
f52df75bc2 Add back opacity change 2021-07-16 17:26:04 +02:00
Henrik Giesel
272f2f7d1a Revert to MathJax through script tag 2021-07-16 16:56:57 +02:00
Henrik Giesel
a616d0dfbc Add copyright header 2021-07-16 16:56:57 +02:00
Henrik Giesel
d41530f4cc Satisfy formatter 2021-07-16 16:56:57 +02:00
Henrik Giesel
ac3577455d Satisfy eslint 2021-07-16 16:56:56 +02:00
Henrik Giesel
ddf3adfc8e Remove protobuf important from reiewer (no longer necessary (?)) 2021-07-16 16:56:56 +02:00
Henrik Giesel
d6393ba996 Do not set opacity to 0 in reviewer 2021-07-16 16:56:56 +02:00
Henrik Giesel
05771b7598 Include MathJax over ts/reviewer 2021-07-16 16:56:56 +02:00
Henrik Giesel
c016f0c8d0 Simplify some reviewer code 2021-07-16 16:56:56 +02:00
Henrik Giesel
ee1a1c35fb Create reviewer/images.ts 2021-07-16 16:56:56 +02:00
Henrik Giesel
5cbb582d0b Export jquery via ts/reviewer 2021-07-16 16:56:56 +02:00
Henrik Giesel
68ac505d81 Include css-browser-selector via ts/reviewer 2021-07-16 16:56:56 +02:00
Henrik Giesel
afa8f8a6f0 Export getTypedAnswer 2021-07-16 16:56:56 +02:00
Henrik Giesel
af12756980 Move reviewer to ts/reviewer 2021-07-16 16:56:55 +02:00
Damien Elmes
35b059ecdb split out sync, search, scheduler & config 2021-07-10 21:33:12 +10:00
Damien Elmes
616db33c0e refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:

- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.

The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.

The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.

Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 19:17:05 +10:00
Damien Elmes
1d4b58419e add workaround for protobufjs requiring uppercase package names
I mourn the time lost trying to track this down :-(

https://github.com/protobufjs/protobuf.js/issues/1014

We can't patch the minified file in dist without essentially duplicating
it, so this change also switches from the external file to including
the src file as part of the bundle.
2021-07-10 15:24:01 +10:00
Damien Elmes
9edac805ad support card state mutator in test scheduler
Documentation to come
2021-05-17 16:59:02 +10:00