The current RD-5700 is a road 10 speed derailleur. Shimano road 10 speed rear derailleur's (except Tiagra RD-4700*) share the same actuation ratio as all Shimano rear derailleurs marketed as 7, 8, or 9 speed. A rear derailleurs actuation ratio is the amount of lateral movement of the derailleur cage per mm of cable pulled by the shifter. So Shimano rear derailleurs, MTB and road, plus 10 speed road, all move the same amount per mm of cable pulled by the shifter. It is the shifter which determines the amount of cable pulled, and derailleurs sharing the same actuation ratio will respond to this cable pull exactly the same. Since the amount of cable pull necessary varies with the number of cogs in the rear cassette, the shifter determines how many rear gears you can run. Not only does the correct shifter have the proper number of detents (a ten speed shifter will have 9 clicks, corresponding to the 9 moves from 1st cog to the tenth cog of a 10 speed cassette) but also pulls the correct amount of cable to cause the correct amount of lateral derailleur movement to move the chain over the gap between cogs. Generally, inter-cog spacing changes (narrows) as you add more rear cogs (gears). For example the overall width of an 8 speed Shimano cassette is the same as a 10 speed cassette, but since you need to fit 2 additional cogs into the same overall space, the distance between cogs (and the thickness of the cogs themselves) of the 10 speed cassette is reduced compared to an 8 speed cassette's cogs and their inter-cog spacing. This is important to keep in mind. It boils down to you must have an x speed shifter if you want to run x speed cassette. The shifter will have x-speed amount of cable pull to move the derailleur x-speed amount of inter cog spacing.
Getting back to actuation ratio of rear derailleurs (which, again, is the same for all Shimano road and mountain, 7 thru 9 speed plus 10 speed road rear derailleurs): you could take your RD-5700 derailleur, a 10 speed road derailleur, and put it with a Sora 9 speed shifter and 9 speed cassette and it would function perfectly. You could use the RD-5700 on a mountain bike that has a Shimano Deore 8 speed shifter and an 8 speed XT cassette, and that derailleur would move the proper 8 speed distance because of the shifters 8 speed input (cable pull).
Starting with Shimano 10 speed mountain things begin to diverge as far as derailleur actuation ratios. Very basically, each speed class of derailleur after 9 speed mountain and after 10 speed road each have a different and incompatible actuation ratio. You must use a 10 speed mountain derailleur with a 10 speed mountain shifter and 10 speed cassette. On the road side, if you want 11 gears on a cassette, you must have a Shimano 11 speed shifter, combined with an 11 speed rear derailleur from Shimano. HEREIN LIES THE ANSWER TO YOUR QUESTION: to continue to use the RD-5700 on your drop bar road bike, any new shifter must be 7,8, 9 or 10 speed road and the cassette must have the identical number of cogs as the shifter speeds. If you get an 11 speed road shifter (say the 105, STI-5800) the RD-5700 will not respond correctly to the 11 speed shifter input since 10 and 11 speed rear derailleurs have a different actuation ratios. One cannot mix 10 and 11 speed rear drivetrain components and expect appropriate shift quality.
*Tiagra 4700 series is always a side note in this type of compatibility discussion. It is a 10 speed groupset that has the actuation ratio of 11 speed road. Essentially (& easiest to get across) is Tiagra 4700 components should be used together. Yes you could put an RD-4700 into an otherwise 11 speed road rear drive train (11 speed road shifter and 11 speed road cassette). But using the Tiagra 4700 shifter within an 11 speed system would not have all the necessary detents for 11 gears.