anki/cargo
RumovZ 3672b0fe73
Switch CardInfoDialog to ts page (#1414)
* Only collect card stats on the backend ...

... instead of rendering an HTML string using askama.

* Add ts page Card Info

* Update test for new `col.card_stats()`

* Remove obsolete CardStats code

* Use new ts page in `CardInfoDialog`

* Align start and end instead of left and right

Curiously, `text-align: start` does not work for `th` tags if assigned
via classes.

* Adopt ts refactorings after rebase

#1405 and #1409

* Clean up `ts/card-info/BUILD.bazel`

* Port card info logic from Rust to TS

* Move repeated field to the top

https://github.com/ankitects/anki/pull/1414#discussion_r725402730

* Convert pseudo classes to interfaces

* CardInfoPage -> CardInfo

* Make revlog in card info optional

* Add legacy support for old card stats

* Check for undefined instead of falsy

* Make Revlog separate component

* drop askama dependency (dae)

* Fix nightmode for legacy card stats
2021-10-14 19:22:47 +10:00
..
remote Switch CardInfoDialog to ts page (#1414) 2021-10-14 19:22:47 +10:00
BUILD.bazel update to the latest rules_rust + security framework update 2021-03-27 19:28:19 +10:00
BUILD.reqwest.native.bazel update Rust deps 2021-10-02 20:42:03 +10:00
BUILD.reqwest.rustls.bazel update Rust deps 2021-10-02 20:42:03 +10:00
BUILD.term-0.7.0.bazel update Rust deps 2021-10-02 20:42:03 +10:00
crates.bzl Switch CardInfoDialog to ts page (#1414) 2021-10-14 19:22:47 +10:00
licenses.json Switch CardInfoDialog to ts page (#1414) 2021-10-14 19:22:47 +10:00
README.md update cargo-raze instructions 2021-10-02 16:24:44 +10:00
update.py update Rust deps 2021-10-02 20:42:03 +10:00

This folder integrates Rust crates.io fetching into Bazel.

To update dependencies, ensure a local Rust environment is available (eg install rustup), then install this version of cargo raze:

cargo install --git https://github.com/ankitects/cargo-raze.git --branch build-deps cargo-raze
cargo install cargo-license

After updating dependencies in ../rslib/Cargo.toml, change to this folder and run python update.py to update the external Bazel repositories to point to the updated deps.

A couple of crates need extra work to build with Bazel, and are listed in ../Cargo.toml. For example:

[package.metadata.raze.crates.pyo3.'*']
compile_data_attr = "glob([\"**\"])"

With minor version updates, you should not normally need to modify the entries in that file.

Because update.py modifies a lot of files in remote/, it makes it difficult to review in a PR, and the changes can sometimes break platforms like Windows. For this reason, please don't submit PRs that do minor version bumps - those will typically be done after stable releases. If you need a new crate for a feature you're working on, please raise it in an issue first.

Reqwest

Things are complicated with reqwest at the moment, because:

  • we're using a fork to implement better timeouts for syncing
  • we want to build it with different features on Linux (where we can't build a wheel that links to OpenSSL), and on other platforms.

For minor version bumps, update.py should take care of updating the versions of reqwest dependencies.

After making a big update to reqwest via an updated fork, the vendored BUILD.reqwest.* files may need updating. To do that, comment native-tls from the features in rslib/Cargo.toml and run update.py, and copy the file in remote/ over the old vendored file. Then comment the other two deps out, add native-tls back, and repeat the process.