The only reason they would discontinue them is if they were no longer profitable. Porsche makes a ton of money on their cars. I believe it is around $17,000 per car sold. So even if that is less on the 718 - perhaps $10,000 - due to the lower prices of the car, that is still a lot of money. How many did they sell last year world wide? Wasn't it around 25,000? If that is the case then they are making around 250 million in profit on the 718s. They aren't going to cut that.
Also the 718 is the entry level car. You get buyers hooked into the brand with a less expensive car, and then hopefully they make buy the more expensive models in the future.
As was mentioned above, at some point all cars will be electric (what will the 718 haters say about sound then!). There will be some sort of electric sports car similar to the 718. It won't be a 718 at that point, but will be a similar concept of a car.