Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-shakespeare for openSUSE:Factory
checked in at 2026-11-24 12:34:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-shakespeare (Old)
and /work/SRC/openSUSE:Factory/.ghc-shakespeare.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-shakespeare"
Tue Nov 24 12:34:13 2026 rev:15 rq:1399322 version:2.2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-shakespeare/ghc-shakespeare.changes
2025-10-10 17:12:50.942079505 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-shakespeare.new.1340718/ghc-shakespeare.changes
2026-11-24 12:41:45.567416366 +0100
@@ -1,0 +2,45 @@
+Tue Nov 4 14:56:39 UTC 2025 - Peter Simons <[email protected]>
+
+- Update shakespeare to version 2.2.0.
+ ### 2.2.0
+
+ * Added $component with binding for reusable blocks
+
+ You can now bind a component-producing function and reuse its sub-components
within the same Hamlet block.
+
+ #### Example
+
+ ```haskell
+ data Modal = Modal
+ { modalHeader :: Widget -> Widget
+ , modalBody :: Widget -> Widget
+ }
+
+ modalWidget :: (Modal -> Widget) -> Widget
+ ```
+
+ ```hamlet
+ $component modal <- modalWidget
+ $component modalHeader modal
+ <h1>This is the title
+
+ $component modalBody modal
+ <p>This is the content
+ ```
+
+ Conceptually, this desugars to:
+
+ ```haskell
+ ^{ modalWidget $ \modal ->
+ [whamlet|
+ ^{ modalHeader modal [whamlet| <h1>This is the title |] }
+ ^{ modalBody modal [whamlet| <p>This is the content |] }
+ |]
+ }
+ <p>outside
+ ```
+
+ Since everything here is just plain Haskell, you can freely pass additional
data or parameters to your component-producing function—`modalWidget` and its
subcomponents are ordinary functions.
+ Only the *outermost* component (`modalWidget` in this case) needs to follow
the `(Modal -> Widget) -> Widget` pattern; all nested subcomponents can have
arbitrary types and arguments.
+
+-------------------------------------------------------------------
Old:
----
shakespeare-2.1.7.1.tar.gz
New:
----
shakespeare-2.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-shakespeare.spec ++++++
--- /var/tmp/diff_new_pack.0pX4I2/_old 2026-11-24 12:41:46.655462473 +0100
+++ /var/tmp/diff_new_pack.0pX4I2/_new 2026-11-24 12:41:46.663462813 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-shakespeare
#
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,62 +17,67 @@
%global pkg_name shakespeare
-%global pkgver %{pkg_name}-%{version}
+%bcond_with ghc_prof
%bcond_with tests
-Name: ghc-%{pkg_name}
-Version: 2.1.7.1
+Name: ghc-%pkg_name
+Version: 2.2.0
Release: 0
+%global pkgver %pkg_name-%{version}
Summary: A toolkit for making compile-time interpolated templates
License: MIT
-URL: https://hackage.haskell.org/package/%{pkg_name}
-Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+URL: https://hackage.haskell.org/package/%pkg_name
+Source0:
https://hackage.haskell.org/package/%pkg_name-%{version}/%pkg_name-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-aeson-devel
-BuildRequires: ghc-aeson-prof
BuildRequires: ghc-base-devel
-BuildRequires: ghc-base-prof
BuildRequires: ghc-blaze-html-devel
-BuildRequires: ghc-blaze-html-prof
BuildRequires: ghc-blaze-markup-devel
-BuildRequires: ghc-blaze-markup-prof
BuildRequires: ghc-bytestring-devel
-BuildRequires: ghc-bytestring-prof
BuildRequires: ghc-containers-devel
-BuildRequires: ghc-containers-prof
BuildRequires: ghc-directory-devel
-BuildRequires: ghc-directory-prof
BuildRequires: ghc-exceptions-devel
-BuildRequires: ghc-exceptions-prof
BuildRequires: ghc-file-embed-devel
-BuildRequires: ghc-file-embed-prof
BuildRequires: ghc-parsec-devel
-BuildRequires: ghc-parsec-prof
BuildRequires: ghc-process-devel
-BuildRequires: ghc-process-prof
-BuildRequires: ghc-rpm-macros
+BuildRequires: ghc-rpm-macros >= 2.9.2
BuildRequires: ghc-scientific-devel
-BuildRequires: ghc-scientific-prof
BuildRequires: ghc-template-haskell-devel
-BuildRequires: ghc-template-haskell-prof
BuildRequires: ghc-text-devel
-BuildRequires: ghc-text-prof
BuildRequires: ghc-th-lift-devel
-BuildRequires: ghc-th-lift-prof
BuildRequires: ghc-time-devel
-BuildRequires: ghc-time-prof
BuildRequires: ghc-transformers-devel
-BuildRequires: ghc-transformers-prof
BuildRequires: ghc-unordered-containers-devel
-BuildRequires: ghc-unordered-containers-prof
BuildRequires: ghc-vector-devel
-BuildRequires: ghc-vector-prof
ExcludeArch: %{ix86}
+%if %{with ghc_prof}
+BuildRequires: ghc-aeson-prof
+BuildRequires: ghc-base-prof
+BuildRequires: ghc-blaze-html-prof
+BuildRequires: ghc-blaze-markup-prof
+BuildRequires: ghc-bytestring-prof
+BuildRequires: ghc-containers-prof
+BuildRequires: ghc-directory-prof
+BuildRequires: ghc-exceptions-prof
+BuildRequires: ghc-file-embed-prof
+BuildRequires: ghc-parsec-prof
+BuildRequires: ghc-process-prof
+BuildRequires: ghc-scientific-prof
+BuildRequires: ghc-template-haskell-prof
+BuildRequires: ghc-text-prof
+BuildRequires: ghc-th-lift-prof
+BuildRequires: ghc-time-prof
+BuildRequires: ghc-transformers-prof
+BuildRequires: ghc-unordered-containers-prof
+BuildRequires: ghc-vector-prof
+%endif
%if %{with tests}
BuildRequires: ghc-HUnit-devel
-BuildRequires: ghc-HUnit-prof
BuildRequires: ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires: ghc-HUnit-prof
BuildRequires: ghc-hspec-prof
%endif
+%endif
%description
Shakespeare is a family of type-safe, efficient template languages.
@@ -101,24 +106,27 @@
%description devel
This package provides the Haskell %{pkg_name} library development files.
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
Summary: Haskell %{pkg_name} library documentation
Requires: ghc-filesystem
BuildArch: noarch
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
This package provides the Haskell %{pkg_name} library documentation.
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
Summary: Haskell %{pkg_name} profiling library
-Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
+Requires: ghc-%pkg_name-devel = %{version}-%{release}
+Supplements: (ghc-%pkg_name-devel and ghc-prof)
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
This package provides the Haskell %{pkg_name} profiling library.
+%endif
+
%prep
-%autosetup -n %{pkg_name}-%{version}
+%autosetup -p1 -n %pkg_name-%{version}
%build
%ghc_lib_build
@@ -141,8 +149,10 @@
%files devel -f %{name}-devel.files
%doc ChangeLog.md
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
%license LICENSE
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
++++++ shakespeare-2.1.7.1.tar.gz -> shakespeare-2.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.1.7.1/ChangeLog.md
new/shakespeare-2.2.0/ChangeLog.md
--- old/shakespeare-2.1.7.1/ChangeLog.md 2025-10-08 18:40:11.000000000
+0200
+++ new/shakespeare-2.2.0/ChangeLog.md 2025-11-04 15:56:35.000000000 +0100
@@ -1,5 +1,46 @@
# ChangeLog for shakespeare
+### 2.2.0
+
+* Added $component with binding for reusable blocks
+
+You can now bind a component-producing function and reuse its sub-components
within the same Hamlet block.
+
+#### Example
+
+```haskell
+data Modal = Modal
+ { modalHeader :: Widget -> Widget
+ , modalBody :: Widget -> Widget
+ }
+
+modalWidget :: (Modal -> Widget) -> Widget
+```
+
+```hamlet
+$component modal <- modalWidget
+ $component modalHeader modal
+ <h1>This is the title
+
+ $component modalBody modal
+ <p>This is the content
+```
+
+Conceptually, this desugars to:
+
+```haskell
+^{ modalWidget $ \modal ->
+ [whamlet|
+ ^{ modalHeader modal [whamlet| <h1>This is the title |] }
+ ^{ modalBody modal [whamlet| <p>This is the content |] }
+ |]
+ }
+<p>outside
+```
+
+Since everything here is just plain Haskell, you can freely pass additional
data or parameters to your component-producing function—`modalWidget` and its
subcomponents are ordinary functions.
+Only the *outermost* component (`modalWidget` in this case) needs to follow
the `(Modal -> Widget) -> Widget` pattern; all nested subcomponents can have
arbitrary types and arguments.
+
### 2.1.7.1
* Add missing other-messages to shakespeare.cabal
[#299](https://github.com/yesodweb/shakespeare/pull/299)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.1.7.1/Text/Hamlet/Parse.hs
new/shakespeare-2.2.0/Text/Hamlet/Parse.hs
--- old/shakespeare-2.1.7.1/Text/Hamlet/Parse.hs 2025-06-05
17:55:31.000000000 +0200
+++ new/shakespeare-2.2.0/Text/Hamlet/Parse.hs 2025-11-04 15:56:35.000000000
+0100
@@ -66,6 +66,7 @@
| LineNothing
| LineCase Deref
| LineOf Binding
+ | LineComponent (Maybe Binding) Deref
| LineTag
{ _lineTagName :: String
, _lineAttr :: [(Maybe Deref, String, Maybe [Content])]
@@ -125,6 +126,7 @@
controlWith <|>
controlCase <|>
controlOf <|>
+ controlComponent <|>
angle <|>
invalidDollar <|>
(eol' >> return (LineContent [] True)) <|>
@@ -238,6 +240,14 @@
_ <- spaceTabs
eol
return $ LineOf x
+ controlComponent = do
+ _ <- try $ string "$component"
+ spaces
+ (x, b) <- (second Just <$> try binding) <|>
+ ((\x -> (x, Nothing)) <$> parseDeref)
+ _ <- spaceTabs
+ eol
+ return $ LineComponent b x
content cr = do
x <- many $ content' cr
case cr of
@@ -450,6 +460,7 @@
| DocCond [(Deref, [Doc])] (Maybe [Doc])
| DocMaybe Deref Binding [Doc] (Maybe [Doc])
| DocCase Deref [(Binding, [Doc])]
+ | DocComponent (Maybe Binding) Deref [Doc]
| DocContent Content
deriving (Show, Eq, Read, Data, Typeable)
@@ -486,6 +497,10 @@
cases <- mapM getOf inside
rest' <- nestToDoc set rest
Ok $ DocCase d cases : rest'
+nestToDoc set (Nest (LineComponent b d) inside:rest) = do
+ inside' <- nestToDoc set inside
+ rest' <- nestToDoc set rest
+ Ok $ DocComponent b d inside' : rest'
nestToDoc set (Nest (LineTag tn attrs content classes attrsD avoidNewLine)
inside:rest) = do
let attrFix (x, y, z) = (x, y, [(Nothing, z)])
let takeClass (a, "class", b) = Just (a, fromMaybe [] b)
@@ -546,6 +561,8 @@
DocForall d i (compressDoc doc) : compressDoc rest
compressDoc (DocWith dis doc:rest) =
DocWith dis (compressDoc doc) : compressDoc rest
+compressDoc (DocComponent b d i:rest) =
+ DocComponent b d i : compressDoc rest
compressDoc (DocMaybe d i doc mnothing:rest) =
DocMaybe d i (compressDoc doc) (fmap compressDoc mnothing)
: compressDoc rest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.1.7.1/Text/Hamlet/RT.hs
new/shakespeare-2.2.0/Text/Hamlet/RT.hs
--- old/shakespeare-2.1.7.1/Text/Hamlet/RT.hs 2025-06-05 17:35:51.000000000
+0200
+++ new/shakespeare-2.2.0/Text/Hamlet/RT.hs 2025-11-04 15:56:35.000000000
+0100
@@ -112,6 +112,7 @@
docs'' <- mapM convert docs'
return (deref', docs'')
convert DocWith{} = error "Runtime hamlet does not currently support $with"
+ convert DocComponent{} = error "Runtime hamlet does not currently support
$component"
convert DocCase{} = error "Runtime hamlet does not currently support $case"
renderHamletRT :: MonadThrow m
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.1.7.1/Text/Hamlet.hs
new/shakespeare-2.2.0/Text/Hamlet.hs
--- old/shakespeare-2.1.7.1/Text/Hamlet.hs 2025-10-07 18:32:43.000000000
+0200
+++ new/shakespeare-2.2.0/Text/Hamlet.hs 2025-11-04 15:56:35.000000000
+0100
@@ -216,6 +216,22 @@
inside' <- docToExp env hr scope' (DocWith dis inside)
let lam = LamE [pat] inside'
return $ lam `AppE` deref'
+docToExp env hr scope (DocComponent mbinding deref inside) = do
+ let deref' = derefToExp scope deref
+ case mbinding of
+ Just binding -> do
+ (pat, extraScope) <- bindingPattern binding
+ let scope' = extraScope ++ scope
+ inside' <-
+ hrWithEnv hr $ \env ->
+ docsToExp env hr scope' inside
+ hrEmbed hr env $ deref' `AppE` LamE [pat] inside'
+ Nothing -> do
+ inside' <-
+ hrWithEnv hr $ \env ->
+ docsToExp env hr scope inside
+ hrEmbed hr env $ deref' `AppE` inside'
+
docToExp env hr scope (DocMaybe val idents inside mno) = do
let val' = derefToExp scope val
(pat, extraScope) <- bindingPattern idents
@@ -594,6 +610,7 @@
justContent (DocContent c) = c
justContent DocForall{} = unsupported "$forall"
justContent DocWith{} = unsupported "$with"
+ justContent DocComponent{} = unsupported "$component"
justContent DocMaybe{} = unsupported "$maybe"
justContent DocCase{} = unsupported "$case"
justContent DocCond{} = unsupported "attribute conditionals"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.1.7.1/shakespeare.cabal
new/shakespeare-2.2.0/shakespeare.cabal
--- old/shakespeare-2.1.7.1/shakespeare.cabal 2025-10-08 18:40:18.000000000
+0200
+++ new/shakespeare-2.2.0/shakespeare.cabal 2025-11-04 15:56:35.000000000
+0100
@@ -1,5 +1,5 @@
name: shakespeare
-version: 2.1.7.1
+version: 2.2.0
license: MIT
license-file: LICENSE
author: Michael Snoyman <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.1.7.1/test/Text/HamletSpec.hs
new/shakespeare-2.2.0/test/Text/HamletSpec.hs
--- old/shakespeare-2.1.7.1/test/Text/HamletSpec.hs 2025-06-05
17:55:31.000000000 +0200
+++ new/shakespeare-2.2.0/test/Text/HamletSpec.hs 2025-11-04
15:56:35.000000000 +0100
@@ -22,6 +22,11 @@
import Text.Blaze.Internal (preEscapedString)
import Text.Blaze
+data ExampleModal widget = ExampleModal
+ { modalHeader :: widget -> widget,
+ modalContent :: widget -> widget
+ }
+
spec = do
it "empty" caseEmpty
it "static" caseStatic
@@ -519,6 +524,63 @@
>
|]
+ it "supports $component without binding" $
+ let
+ container :: String -> HtmlUrl url -> HtmlUrl url
+ container clazz x =
+ [hamlet|
+ $newline never
+ <div class="container #{clazz}">
+ ^{x}
+ |]
+ in
+ helper "<div class=\"container alert\"><p>Hello
world</p></div><p>outside</p>"
+ [hamlet|
+ $newline never
+ $component container "alert"
+ <p>Hello world
+ <p>outside
+ |]
+
+ it "supports $component with binding (modal example)" $
+ let
+ modalWidget :: (ExampleModal (HtmlUrl url) -> HtmlUrl url) ->
HtmlUrl url
+ modalWidget body =
+ let
+ exampleModal =
+ ExampleModal
+ { modalHeader = \content ->
+ [hamlet|
+ $newline never
+ <div class="modal-header">
+ ^{content}
+ |],
+ modalContent = \content ->
+ [hamlet|
+ $newline never
+ <div class="modal-content">
+ ^{content}
+ |]
+ }
+ in
+ [hamlet|
+ $newline never
+ <div class="modal">
+ ^{body exampleModal}
+ |]
+ in
+ helper "<div class=\"modal\"><div class=\"modal-header\"><h1>This
is the title</h1></div><div class=\"modal-content\"><p>This is the
content</p></div></div><p>outside</p>"
+ [hamlet|
+ $newline never
+ $component modal <- modalWidget
+ $component modalHeader modal
+ <h1>This is the title
+
+ $component modalContent modal
+ <p>This is the content
+ <p>outside
+ |]
+
it "runtime Hamlet with caret interpolation" $ do
let toInclude render = render (5, [("hello", "world")])
let renderer x y = pack $ show (x :: Int, y :: [(Text, Text)])