Commit graph

22 commits

Author SHA1 Message Date
Damien Elmes
e3b53fc078 split out remaining tags, stats, media and rendering 2021-07-10 23:16:18 +10:00
Damien Elmes
5255409093 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
d89c538c48 in/out -> request/response
The saved characters weren't worth the increased difficulty when
reading, and the fact that we were deviating from protobuf norms.
2021-06-20 15:49:20 +10:00
Damien Elmes
3489257f41 update ts deps
- prettier's formatting has changed, so files needed to be reformatted
- dart is spitting out deprecation warnings like:

254 │   2: $spacer / 2,
    │      ^^^^^^^^^^^
    ╵
    bazel-out/darwin-fastbuild/bin/ts/sass/bootstrap/_variables.scss 254:6  @import
    ts/sass/button_mixins.scss 2:9                                          @use
    ts/components/ColorPicker.svelte 2:5                                    root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($grid-gutter-width, 2)
2021-05-26 09:37:40 +10:00
Henrik Giesel
31eaeef09b Rename anki/ to lib/ for export
import _ from "anki/x";

will become

import _ from "lib/x";

to fit the directory name.
2021-04-23 10:02:28 +10:00
Damien Elmes
de5f892807 allow postrequest to send a binary body; fix WithGraphData
As far as I can tell, the existing code was transforming the encoded
protobuf data into UTF8, and we're just lucky it wasn't causing problems
with the small message we were sending.
2021-04-20 17:47:52 +10:00
Henrik Giesel
a6f74a387a Satisfy ./script/svelte-check 2021-04-16 03:10:39 +02:00
Henrik Giesel
1e5b2a06a3 Pass the svelte check for graphs 2021-04-15 13:09:50 +02:00
Henrik Giesel
36c031a0ca Inline GraphData/GraphPreferences getters/setters into WithGraphData 2021-04-15 13:09:50 +02:00
Henrik Giesel
eebbf71256 Generalize ts/graphs/preferences to ts/sveltelib/preferences 2021-04-15 13:09:50 +02:00
Damien Elmes
eb6502bd6e add missing copyright headers to *.svelte 2021-04-13 19:02:41 +10:00
Henrik Giesel
730d75a6c4 Satisfy svelte_check 2021-03-22 15:41:43 +01:00
Henrik Giesel
8bf68ea7ca Satisfy formatter 2021-03-22 15:25:49 +01:00
Henrik Giesel
12123fc68b Remove assignment to preferencesPromise: getPreferences will only be called once 2021-03-22 04:03:52 +01:00
Henrik Giesel
0368bac9be Move async and asyncReactive to sveltelib
- sveltelib is a lib for component-agnostic svelte utils
2021-03-22 03:06:53 +01:00
Henrik Giesel
8cb7d4a8ad Create search and days writable in GraphsPage to allow browserSearch to work 2021-03-22 02:44:08 +01:00
Henrik Giesel
abdf8a464f Remove pending, and resort to checking for value
- once value is set, it won't be unset
2021-03-22 01:42:23 +01:00
Henrik Giesel
6d2d40472d Use preferencesPromise, as refreshing is handled over stores 2021-03-22 01:42:23 +01:00
Henrik Giesel
fbf2c6f6fc Rename search and days to initialSearch and intitialDays in GraphsPage 2021-03-22 01:42:23 +01:00
Henrik Giesel
4ef0b3c977 Get it to work, if you change the input
- there's still an issue on initial load
2021-03-22 01:42:23 +01:00
Henrik Giesel
26d4854502 Compiles with WithGraphData 2021-03-22 01:42:23 +01:00
Henrik Giesel
cfaf0e587b Add WithGraphData 2021-03-22 01:40:51 +01:00