kokarn / tarkov-tools

https://tarkov-tools.com
MIT License
70 stars 44 forks source link

load single item first works #158

Open Gyran opened 2 years ago

Gyran commented 2 years ago

When opening an item, try to load as little data as possible to be able to display something quickly. Then load everything and show everything!

netlify[bot] commented 2 years ago

✔️ Deploy Preview for tarkov-tools-preview ready!

🔨 Explore the source changes: a2085b50088a790499ffbbffb774076b12265fd5

🔍 Inspect the deploy log: https://app.netlify.com/sites/tarkov-tools-preview/deploys/622158329a8f8800084e2794

😎 Browse the preview: https://deploy-preview-158--tarkov-tools-preview.netlify.app/

kokarn commented 2 years ago

Great work! This would help that page SO much....

Some notes:

  1. All items are still loaded, can we avoid that or make sure that triggers after the single item is done?
  2. If we have a redirect it seems to render a failed page instead? Example is 9x39mm-bp on preview vs 9x39mm-bp on live
  3. Loading items by id seems to load in a weird order. Loading page -> error page -> item page. bitcoin item by id
Gyran commented 2 years ago
  1. I'll see what I can do
  2. From what I can see, redirects are done in the worker part of the site? So I guess that dosen't work the same on netlify?
  3. Because we get the item by id a little later, I could get by normalized name and id at the same time for single item so it would be a little slower but catch that case that we do the redirect when all items has loaded.
kokarn commented 2 years ago

Ah, yeah 2. makes sense 👍 and good call on the others