I assume you are publishing shapefiles from ArcGIS Pro given your description above. When publishing from Pro, it may be advantageous to keep the service definition around if you want to make future changes. Frankly speaking, if I'm going to publish a shapefile as a hosted feature layer I skip Pro and just do it directly from ArcGIS Online. Your workflow and organizational procedures will dictate the appropriate workflow for you.
Thanks for your answer. I use Arc pro because of the geoprocessing tools to make the changes I want on the layer and then I can publish it on Acronline.
What are you doing to publish the service? Can't imagine a shapefile is created from publishing from ArcGIS Pro.
I imagine you are uploading a Shapefile and publishing to a hosted feature layer. For ArcGIS Online to do this, it will need to upload prior to creating the hosted feature layer... should be fine to delete if you have a local copy and don't want to have a second copy online. It won't be tied to your Hosted Feature Layer.
Thanks for the answer. I use Arcpro tools to make the changes I want on the shapefile and then I publish it on Arconline and it's the time the shapefile and service definition uploads on Arconline with the feature layer. I don't think there are professional edit tools on Arconline similar to Arcpro. Is it?
You are correct, a shapefile is not a web-publishable format but you can create a feature layer using one. An advantage to keeping the shapefile in the ArcGIS Online workflow is that you can update the hosted feature layer with a new shapefile should it change.
@BernSzukalski Just confirming, if we are not going to update the shapefiles and FGD's, we can delete them without affecting the feature service in AGOL? They end up using credits for hosting files. This question also goes for CSV's.