Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gd_user everywhere for better performance #348

Open
3 tasks
vlad-timotei opened this issue Oct 7, 2021 · 0 comments
Open
3 tasks

Use gd_user everywhere for better performance #348

vlad-timotei opened this issue Oct 7, 2021 · 0 comments

Comments

@vlad-timotei
Copy link
Collaborator

To provide customized experiences (and to prevent errors) we check in the entire project some tings several times in various more or less performant ways.

Since #320, thanks to @webaxones we have a new object that stores all the information needed, obtained using performant methods.

GlotDict/js/glotdict.js

Lines 20 to 25 in f6973ff

const gd_user = {
is_translator: false,
is_editor: false,
is_connected: false,
is_on_translations: false,
};

But we don't use it yet. There are a few chronological things to do:

  • 1. Move gd_user generation code from glotdict.js to glotdict-user.js and load glotdict-user.js first. We want to keep the loading of everything else in glotdict.js last, as proposed by @Mte90 here. We could also move it to another file that loads first, such as glotdict-settings.js, if we don't want an additional file.
  • 2. Find all the checks that can safely be replaced with gd_user evaluations.
  • 3. Replace all of the above.

This would uniformize the checks and improve performance.

@vlad-timotei vlad-timotei added this to the 2.0.4 milestone Oct 7, 2021
@vlad-timotei vlad-timotei modified the milestones: 2.0.4, Future release Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant