question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove react-tokens dependency from react-core pagination by using number formatting

See original GitHub issue

Describe the issue. What is the expected and unexpected behavior? When passing large number of items to pagination it automatically expands and take too much space on toolbar. This should be resolved by using Verify Number Formats (specification for short writing large numbers) - 400, 4K,400K, 4M, 400M,4B,400B,4B ,400B , 4T. We have an account with 44296 items which will eventually be shown as 4430 number of pages. It would be easier to read if we’d show 44K items and 4K pages. If user hovers over pagination element he could see tooltip with full information

Number of items: 44 296
Number of pages: 4 430
Items per page: 10

Ideally I’d like to pass custom renderer to pagination count in order to use custom renderer for any number.

I guess that this could eventually be part of design guidelines so we can use this number formatting in any place.

I am raising this issue, because we’ve tried using the latest build (>=4.0.0) and we’ve noticed bundle increase and identified react-tokens as one culprit of this problem Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.

Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around? Enhancement.

What is your product and what release version are you targeting? cloud.redhat.com

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
redallencommented, May 6, 2020

Yes, it should! I’m seeing 23% size reduction with the seed app.

  • React-core dist size down 20Kb due to smaller base.css , withOUIA removal, and smaller react-icons (down to 8Kb from 16Kb) and react-styles (down to 6Kb from 11Kb)
  • Overall dist size down 63Kb due to removing no-case and create-emotion as a dependency from react-styles (26Kb + 32Kb), and then an extra 5Kb was shaved in babel helpers being able to consolidate down into tslib.es6.ts which the seed app already depends on (since it’s Typescript)
0reactions
rvsiacommented, May 6, 2020

@redallen So, the bundle size will be fixed in the next major release?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Control pagination - Microsoft Support
On the Format menu, click Paragraph, and then click the Line and Page Breaks tab. Select the Keep with next check box. Always...
Read more >
patternfly-react/RELEASE-NOTES.md at main - GitHub
A set of React components for the PatternFly project. - patternfly-react/RELEASE-NOTES.md at main · patternfly/patternfly-react.
Read more >
How to Build a Custom Pagination Component in React
We will just be using a simple additional dependency called classnames which ... Our pagination hook must return the range of numbers to...
Read more >
Release notes - PatternFly 4
Removed unused packages from repo (#3916); Created unified react-core dist (#3971); Created variables by file in react-tokens (#3896).
Read more >
How To Build Custom Pagination with React | DigitalOcean
Run the following command to install the required dependencies: npm install bootstrap @4.1.0 prop-types @15.6.1 react-flags ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found