Polymerases that synthesize artificial genetic polymers hold great promise for advancing future applications in synthetic biology. However, engineering natural polymerases to replicate unnatural genetic polymers is a challenging problem. Here we present droplet-based optical polymerase sorting (DrOPS) as a general strategy for expanding polymerase function that employs an optical sensor to monitor polymerase activity inside the microenvironment of a uniform synthetic compartment generated by microfluidics. We validated this approach by performing a complete cycle of encapsulation, sorting and recovery on a doped library and observed an enrichment of ∼1,200-fold for a model engineered polymerase. We then applied our method to evolve a manganese-independent α-L-threofuranosyl nucleic acid (TNA) polymerase that functions with >99% template-copying fidelity. Based on our findings, we suggest that DrOPS is a versatile tool that could be used to evolve any polymerase function, where optical detection can be achieved by Watson–Crick base pairing.