ankitects / ankitects/anki

Re-export FSRS constants

Open
#4,099 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.5k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
72

Description

@dae, the constant has been exposed in fsrs-rs. But the affected code is in TypeScript.

https://github.com/open-spaced-repetition/fsrs-rs/blob/75cfeeaaf560bf9f30a714b42dccb3fd2a901696/src/lib.rs#L21

_Originally posted by @L-M-Sherlock in https://github.com/ankitects/anki/issues/4096#issuecomment-2986810890_

One way we could solve this is by adding a Rust binary that exports the constants to a ts file. But that adds an extra build step, with a bit of a performance impact. Another option would be to define a new protobuf struct that holds FSRS constants, and pass that into our pages that need the constants (e.g. returning it as part of the card info).

Contributor guide

Open the contributing guide

Research direction

Start with fsrs-rs/src/lib.rs around line 21, then locate the affected TypeScript code and the pages that need FSRS constants. Compare the proposed Rust-generated TypeScript file with passing a protobuf struct through card info; the work is done when the constants are available to those pages through a chosen approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.