diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,12 @@
+5.2.1 [2023.02.27]
+------------------
+* Allow building with GHC 9.6.
+* Allow building with GHC backends where `HTYPE_SIG_ATOMIC_T` is not defined,
+  such as the WASM backend.
+* Support building with `th-abstraction-0.5.*`.
+* Define `_TypeDataD` in `Language.Haskell.TH.Lens` when building with
+  `template-haskell-2.20.0.0` (GHC 9.6) or later.
+
 5.2 [2022.08.11]
 ----------------
 * Allow building with GHC 9.4.
diff --git a/examples/lens-examples.cabal b/examples/lens-examples.cabal
--- a/examples/lens-examples.cabal
+++ b/examples/lens-examples.cabal
@@ -23,7 +23,9 @@
              , GHC == 8.8.4
              , GHC == 8.10.7
              , GHC == 9.0.2
-             , GHC == 9.2.2
+             , GHC == 9.2.6
+             , GHC == 9.4.4
+             , GHC == 9.6.1
 
 source-repository head
   type: git
diff --git a/lens-properties/lens-properties.cabal b/lens-properties/lens-properties.cabal
--- a/lens-properties/lens-properties.cabal
+++ b/lens-properties/lens-properties.cabal
@@ -20,7 +20,9 @@
              , GHC == 8.8.4
              , GHC == 8.10.7
              , GHC == 9.0.2
-             , GHC == 9.2.2
+             , GHC == 9.2.6
+             , GHC == 9.4.4
+             , GHC == 9.6.1
 
 extra-source-files:
   .hlint.yaml
diff --git a/lens.cabal b/lens.cabal
--- a/lens.cabal
+++ b/lens.cabal
@@ -1,6 +1,6 @@
 name:          lens
 category:      Data, Lenses, Generics
-version:       5.2
+version:       5.2.1
 license:       BSD2
 cabal-version: 1.18
 license-file:  LICENSE
@@ -19,7 +19,9 @@
              , GHC == 8.8.4
              , GHC == 8.10.7
              , GHC == 9.0.2
-             , GHC == 9.2.2
+             , GHC == 9.2.6
+             , GHC == 9.4.4
+             , GHC == 9.6.1
 synopsis:      Lenses, Folds and Traversals
 description:
   This package comes \"Batteries Included\" with many useful lenses for the types
@@ -50,7 +52,7 @@
   .
   <<http://i.imgur.com/ALlbPRa.png>>
   .
-  <images/Hierarchy.png (Local Copy)>
+  <https://raw.githubusercontent.com/ekmett/lens/master/images/Hierarchy.png (Local Copy)>
   .
   You can compose any two elements of the hierarchy above using @(.)@ from the @Prelude@, and you can
   use any element of the hierarchy as any type it linked to above it.
@@ -196,9 +198,9 @@
     semigroupoids                 >= 5.0.1    && < 6,
     strict                        >= 0.4      && < 0.5,
     tagged                        >= 0.8.6    && < 1,
-    template-haskell              >= 2.11.1.0 && < 2.20,
+    template-haskell              >= 2.11.1.0 && < 2.21,
     text                          >= 1.2.3.0  && < 2.1,
-    th-abstraction                >= 0.4.1    && < 0.5,
+    th-abstraction                >= 0.4.1    && < 0.6,
     these                         >= 1.1.1.1  && < 1.2,
     transformers                  >= 0.5.0.0  && < 0.7,
     transformers-compat           >= 0.5.0.4  && < 1,
diff --git a/src/Control/Lens/Equality.hs b/src/Control/Lens/Equality.hs
--- a/src/Control/Lens/Equality.hs
+++ b/src/Control/Lens/Equality.hs
@@ -3,9 +3,14 @@
 {-# LANGUAGE Rank2Types #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE TypeOperators #-}
-{-# LANGUAGE TypeInType #-}
 {-# LANGUAGE Trustworthy #-}
 
+#if __GLASGOW_HASKELL__ >= 806
+{-# LANGUAGE PolyKinds #-}
+#else
+{-# LANGUAGE TypeInType #-}
+#endif
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Control.Lens.Equality
@@ -144,8 +149,6 @@
 --
 -- @fromLeibniz' :: (forall f. f s -> f a) -> Equality' s a@
 fromLeibniz' :: (s :~: s -> s :~: a) -> Equality' s a
--- Note: even though its type signature mentions (:~:), this function works just
--- fine in base versions before 4.7.0; it just requires a polymorphic argument!
 fromLeibniz' f = case f Refl of Refl -> id
 {-# INLINE fromLeibniz' #-}
 
diff --git a/src/Control/Lens/Internal/TH.hs b/src/Control/Lens/Internal/TH.hs
--- a/src/Control/Lens/Internal/TH.hs
+++ b/src/Control/Lens/Internal/TH.hs
@@ -154,6 +154,9 @@
 isDataFamily D.Newtype         = False
 isDataFamily D.DataInstance    = True
 isDataFamily D.NewtypeInstance = True
+#if MIN_VERSION_th_abstraction(0,5,0)
+isDataFamily D.TypeData        = False
+#endif
 
 ------------------------------------------------------------------------
 -- TH-quoted names
diff --git a/src/Control/Lens/Iso.hs b/src/Control/Lens/Iso.hs
--- a/src/Control/Lens/Iso.hs
+++ b/src/Control/Lens/Iso.hs
@@ -5,7 +5,12 @@
 {-# LANGUAGE PatternSynonyms #-}
 {-# LANGUAGE ViewPatterns #-}
 {-# LANGUAGE Trustworthy #-}
+
+#if __GLASGOW_HASKELL__ >= 806
+{-# LANGUAGE PolyKinds #-}
+#else
 {-# LANGUAGE TypeInType #-}
+#endif
 
 #include "lens-common.h"
 
diff --git a/src/Control/Lens/Lens.hs b/src/Control/Lens/Lens.hs
--- a/src/Control/Lens/Lens.hs
+++ b/src/Control/Lens/Lens.hs
@@ -6,7 +6,12 @@
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE Trustworthy #-}
+
+#if __GLASGOW_HASKELL__ >= 806
+{-# LANGUAGE PolyKinds #-}
+#else
 {-# LANGUAGE TypeInType #-}
+#endif
 
 #include "lens-common.h"
 
diff --git a/src/Control/Lens/Type.hs b/src/Control/Lens/Type.hs
--- a/src/Control/Lens/Type.hs
+++ b/src/Control/Lens/Type.hs
@@ -5,8 +5,13 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
-{-# LANGUAGE TypeInType #-}
 {-# LANGUAGE Trustworthy #-}
+
+#if __GLASGOW_HASKELL__ >= 806
+{-# LANGUAGE PolyKinds #-}
+#else
+{-# LANGUAGE TypeInType #-}
+#endif
 -------------------------------------------------------------------------------
 -- |
 -- Module      :  Control.Lens.Type
diff --git a/src/Control/Lens/Wrapped.hs b/src/Control/Lens/Wrapped.hs
--- a/src/Control/Lens/Wrapped.hs
+++ b/src/Control/Lens/Wrapped.hs
@@ -1000,7 +1000,12 @@
 
 instance Rewrapped CSigAtomic t
 instance Wrapped CSigAtomic where
-  type Unwrapped CSigAtomic = HTYPE_SIG_ATOMIC_T
+  type Unwrapped CSigAtomic =
+#if defined(HTYPE_SIG_ATOMIC_T)
+    HTYPE_SIG_ATOMIC_T
+#else
+    Int32
+#endif
   _Wrapped' = iso (\(CSigAtomic x) -> x) CSigAtomic
   {-# INLINE _Wrapped' #-}
 
diff --git a/src/Language/Haskell/TH/Lens.hs b/src/Language/Haskell/TH/Lens.hs
--- a/src/Language/Haskell/TH/Lens.hs
+++ b/src/Language/Haskell/TH/Lens.hs
@@ -128,6 +128,9 @@
 #if MIN_VERSION_template_haskell(2,19,0)
   , _DefaultD
 #endif
+#if MIN_VERSION_template_haskell(2,20,0)
+  , _TypeDataD
+#endif
 #if MIN_VERSION_template_haskell(2,12,0)
   -- ** PatSynDir Prisms
   , _Unidir
@@ -1169,6 +1172,16 @@
   where
       reviewer = DefaultD
       remitter (DefaultD x) = Just x
+      remitter _ = Nothing
+#endif
+
+#if MIN_VERSION_template_haskell(2,20,0)
+_TypeDataD :: Prism' Dec (Name, [TyVarBndr ()], Maybe Kind, [Con])
+_TypeDataD
+  = prism' reviewer remitter
+  where
+      reviewer (x, y, z, u) = TypeDataD x y z u
+      remitter (TypeDataD x y z u) = Just (x, y, z, u)
       remitter _ = Nothing
 #endif
 
