Ok, don’t do that ^
Make your life easier and use:
-8-speed cassette with 8–speed shifters
-9-speed cassette with 9-speed shifters
-10-speed cassette with, well, you can see where I’m going here.
You can’t use 10-speed shifters with an 8-speed cassette. The pull ratio is the same, but the gear spacing is different. It won’t index. But,
@vcballbat a 10-speed cassette will fit in the same space as an 8-speed so you could just switch to a 10-speed cassette and it’ll all work correctly. You might need to swap the chain too because I think 10-speed chains have flush rivets to clear the tighter spacing