nestdotland / nest.land

🦕 The Nest Website
https://nest.land
MIT License
371 stars 19 forks source link

Proposal: Show overall number of modules like Deno is doing - see screenshot #267

Closed michael-spengler closed 3 years ago

michael-spengler commented 3 years ago

Screen Shot 2020-09-12 at 11 30 59 PM

in gallery.

Just exploring how this goes together with the lazy loading 24 ... + more on demand ...

If somebody reading this knows if the API provides something like https://x.nest.land/api/modulecount/ please let me know.

TTtie commented 3 years ago

It is provided as a HTTP response header:
https://github.com/nestdotland/x/blob/c94add3607c9fb7b45ac916d5f0776eb0fc0aeb1/src/routes/package.ts#L44

michael-spengler commented 3 years ago

cool thanks - will probably draft this tomorrow.

t8 commented 3 years ago

Would love to see this added! Really smart thinking, @TTtie.

t8 commented 3 years ago

Perhaps we could even consider showing it beside the "shown modules" count instead... image

michael-spengler commented 3 years ago

Perhaps we could even consider showing it beside the "shown modules" count instead... image

I'd rather get rid of this one (x Modules Shown) - it is over the Deno's foot traces - and the info (that there are many modules...) is pretty well in the search field (Search through x modules).

michael-spengler commented 3 years ago

It is provided as a HTTP response header: https://github.com/nestdotland/x/blob/c94add3607c9fb7b45ac916d5f0776eb0fc0aeb1/src/routes/package.ts#L44

It's really cool to have X-Total however it seems that the following is necessary to enable this: Access-Control-Expose-Headers: X-Total

Background: https://stackoverflow.com/questions/37897523/axios-get-access-to-response-header-fields

If that's right: Could anyone tell me where I can do that because so far response.headers only contains / reveals content-type when called via browser / page ?

mjrlowe commented 3 years ago

Perhaps we could even consider showing it beside the "shown modules" count instead... image

Maybe something like "Showing 24 of 100 modules"?

t8 commented 3 years ago

CC @maximousblk & @justablob

maximousblk commented 3 years ago

I like @TheWizardBear's idea of showing

Showing $visible of $total modules

I'd even suggest we should do what deno has with the search box

t8 commented 3 years ago

I really like @TheWizardBear's idea too. I'd be happy with either representation of this data.

michael-spengler commented 3 years ago

ok - does anyone have updates on this one https://github.com/nestdotland/nest.land/issues/267#issuecomment-691703533 ?

As this is imo necessary to get the X-Total