| author | |
| committer | |
| log | bc47a60a1a70ca7d019bd60a1f6571c61de1e52a |
| tree | 31b468d705315f0cd1d96f36d76ab0bf6f038e05 |
| parent | 790cb5e3084dbb0c8b5780899bd85b19dd021cd8 |
| signature |
this reduces rerenders but doesn't affect other features3 files changed, 6 insertions(+), 2 deletions(-)
deno.json+1-1| ... | @@ -1,6 +1,6 @@ | ... | @@ -1,6 +1,6 @@ |
| 1 | { | 1 | { |
| 2 | "name": "@clo/react-markdown", | 2 | "name": "@clo/react-markdown", |
| 3 | "version": "1.1.0", | 3 | "version": "1.1.1", |
| 4 | "exports": { | 4 | "exports": { |
| 5 | ".": "./src/Markdown.ts", | 5 | ".": "./src/Markdown.ts", |
| 6 | "./Predict": "./src/Predict.ts" | 6 | "./Predict": "./src/Predict.ts" |
readme.changes.md+4| ... | @@ -1,5 +1,9 @@ | ... | @@ -1,5 +1,9 @@ |
| 1 | # notable changes in React Markdown | 1 | # notable changes in React Markdown |
| 2 | 2 | ||
| 3 | ## v1.1.1 | ||
| 4 | |||
| 5 | - Patch to the Memoizer to reduce React re-renders on pipeline changes | ||
| 6 | |||
| 3 | ## v1.1 | 7 | ## v1.1 |
| 4 | 8 | ||
| 5 | - Prediction improvements | 9 | - Prediction improvements |
src/Memoizer.ts+1-1| ... | @@ -73,8 +73,8 @@ export class Memoizer { | ... | @@ -73,8 +73,8 @@ export class Memoizer { |
| 73 | this.#keys = []; | 73 | this.#keys = []; |
| 74 | this.#nextKey = 0; | 74 | this.#nextKey = 0; |
| 75 | this.#renderStates = []; | 75 | this.#renderStates = []; |
| 76 | this.#reactNodes = []; | ||
| 77 | this.#predict = predict ? new Predict() : null; | 76 | this.#predict = predict ? new Predict() : null; |
| 77 | // NOTE: do not reset reactNodes so that pipeline changes can preserve the react node state | ||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | update(content: string): readonly ReactNode[] { | 80 | update(content: string): readonly ReactNode[] { |