Performance enhancements galore! New themining system
This is once again a huge commit, but its mostly performance improvements along with some bug fixes and refactoring. It also includes changes to the theming systems. I'm still not 100% happy with the theming system, but its better than before. Model fetching has been dramatically improved! Nearly all the important computation and pre-processing has been moved to the server. This has also somehow fixed the way model details are loaded, which was causing many models to be missing their details despite models.dev having them. The markdown renderer has once again been changed, but I'm mostly certain that this is the last time major changes will be made to it. The renderer is not spamming components, bloating memory usage, and its not using a bug prone custom written chunking system. There's also a lot more that I haven't mentioned and honestly forgot. I need to get better commit hygiene tbh.
This commit is contained in:
+18
-11
@@ -1,13 +1,19 @@
|
||||
const pendingRenames: Map<string, AbortController> = new Map();
|
||||
interface PendingRename {
|
||||
topicId: string;
|
||||
abortController: AbortController;
|
||||
}
|
||||
|
||||
export const cancelPendingRename = (renameId: string): boolean => {
|
||||
const controller = pendingRenames.get(renameId);
|
||||
if (controller) {
|
||||
controller.abort();
|
||||
const pendingRenames: Map<string, PendingRename> = new Map();
|
||||
|
||||
export const cancelPendingRename = (renameId: string): [boolean, PendingRename?] => {
|
||||
const pendingRename = pendingRenames.get(renameId);
|
||||
if (pendingRename?.abortController) {
|
||||
pendingRename.abortController.abort();
|
||||
pendingRenames.delete(renameId);
|
||||
return true;
|
||||
return [true, pendingRename];
|
||||
}
|
||||
return false;
|
||||
|
||||
return [false, undefined];
|
||||
};
|
||||
|
||||
export const completeRename = (renameId: string) => {
|
||||
@@ -17,10 +23,11 @@ export const completeRename = (renameId: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const addPendingRename = (): [string, AbortController] => {
|
||||
export const addPendingRename = (topicId: string): [string, PendingRename] => {
|
||||
const id = crypto.randomUUID();
|
||||
const controller = new AbortController();
|
||||
const abortController = new AbortController();
|
||||
const pendingRename = { topicId, abortController };
|
||||
|
||||
pendingRenames.set(id, controller);
|
||||
return [id, controller];
|
||||
pendingRenames.set(id, pendingRename);
|
||||
return [id, pendingRename];
|
||||
};
|
||||
Reference in New Issue
Block a user