Both is a better option; sending polyfills for every browser feature you'd want to use is easily hundreds of kilobytes. We use user agents to identify a feature set, but we send feature detection down alongside the polyfills. Detecting features in the client side and sending a second network request to load polyfills for that features adds pretty significant round-trip time.