Sorry, confused, I read the acf/setup_fields and completely missed the “JS” part.
Have you looked at the new acf-field-type-template setup? https://github.com/elliotcondon/acf-field-type-template. The JS side has changes as well. There is an example JS file that has the if/else statement for setup depending on if ACF4 or ACF5 is running.