Changelog for ema-0.10.0.0
Revision history for ema
0.10.0.0 (2022-11-20)
- Split Ema into multiple packages:
ema-extra: New API- Expose
StringRoutefrom examples to ema-extra - Add
MapRouteandPaginatedRoute
- Expose
0.8.2.0 (2022-08-28)
- Bug fixes
- Fix live server redirecting static assets to wrong links #138
0.8.0.0 (2022-08-19)
This releases brings a significant rewrite of Ema. If you choose to upgrade your apps from 0.6, see https://ema.srid.ca/start/upgrade for guidance.
- GHC 9.x support
- Better handling of URL anchors (#83; #87)
routeUrlusesUrlDirectby default. UserouteUrlWithif you want to change that.- Ema status indicator now works independently (requires no Tailwind)
- Multisite rewrite (Ema has been mostly rewritten for better composability) (#82)
- Represent route encoding using
Prism'from optics-core; addIsRouteclass to define them.- Optional generic deriving of route prisms, so you do not have to hand-write them.
- Automatic isomorphism checks ensures that encoding and decoding are isomorphic (route prisms are lawful)
- Composable Ema apps
- There are two ways of composing Ema apps. Using heterogenous lists (see
Ema.Route.Lib.Multi), or by defining a top-level route type (seeEx04_Multi.hs).
- There are two ways of composing Ema apps. Using heterogenous lists (see
- Replace
LVarwithDynamic.- Ema still uses
LVarinternally (for live server updates), but on the user-side one only needs to provide aDynamicwhich is a tuple of initial value and an updating function. The unionmount library was changed to provide this tuple.
- Ema still uses
- Add
EmaSitetypeclass to "connect them all"SiteArg: Type of value to pass from the environment.siteInput: Define theDynamicmodel for the site.siteOutput: Asset (eg: HTML) to produce for each route.
- Represent route encoding using
0.6.0.0 -- 2022-02-05
- Websocket API: Add
ema.switchRouteto switch to other routes in live server. - Smaller core: remove helpers and examples (examples can be enabled by a flag)
- Helpers
Ema.Helpers.PathTreemoved to separate package pathtree.Ema.Helpers.FileSystemmoved to separate package unionmount.Ema.Helpers.Markdownmoved to separate package commonmark-simple.Ema.Helpers.Blazeis no more. Seeema-templateif you need a ready made template using blaze HTML and TailwindCSS.
- Examples
with-examplescabal flag is made False by default. Examples are not exposed modules. Ema.Route.Slugmoved to separate package url-slug
- Helpers
0.4.0.0 -- 2022-01-19
- Pin TailwindCSS to 2.x, because the 3.x broke our CDN url
- Remove unused Cabal deps (#61)
Tailwind.layoutWith: don't hardcode<body>attrs- Tailwind: module revamped and renamed to
Tailwind.Helper.Blaze runEmaand friends:- return the monadic's action's return value or generated files (dependent type)
- CLI: add
runsubcommand that takes--hostand--port(and remove environment hacks of $HOST and $PORT)
0.2.0.0 -- 2021-11-21
- TODO(doc) runEma's action gets the
CLI.Actionas argument, to prevent thegencommand from needing to monitoring files. - Live Server
- Avoid unncessary DOM patch on page load
- Handle invalid routes gracefully without breaking websocket
- Re-add
<script>tags on hot reload - Scroll to top on route switches
- Use secure websockets when on HTTPS
- Bind to loopback (127.0.0.1) for security reasons
- Do not handle target=_blank links in websocket route switch
Assettype- Introduce the
Assettype to distinguishing between static files and generated files. The later can be one ofHtmlorOther, allowing the live server to handle them sensibly. Ematypeclass:- Drop
staticAssetsin favour ofallRoutes(renamed fromstaticRoutes) returning all routes including both generated and static routes. - Drop
Slugand use plainFilePath. Route encoder and decoder deal directly with the on-disk path of the generated (or static) files.
- Drop
- Make the render function (which
runEmatakes) return aAsset LByteStringinstead ofLByteStringsuch that it can handle all routes, and handle static files as well as generation of non-HTML content (eg: RSS) - Allow copying static files anywhere on the filesystem
- Introduce the
routeUrl:- Unicode normalize as well URI encode route URLs
- now returns relative URLs (ie. without the leading
/)- Use the
<base>tag to specify an explicit prefix for relative URLs in generated HTML. This way hosting on GitHub Pages without CNAME will continue to have functional links.
- Use the
- Fix: prevent encoding of non-HTML paths
- Now takes the
modeltype as argument, inasmuch asencodeRoutetakes it as as well (to accomodate scenarios where route path can only be computed depending on model state; storing slug aliases for instance) - Add
routeUrlWithfor non-pretty URLs
Ema.Slug- Add
Ord,Generic,Dataand Aeson instances toSlug - Unicode normalize slugs using NFC
- Add
decodeSlugandencodeSlug
- Add
- Add default implementation based on Enum for
allRoutes - Warn, without failing, on missing static assets during static generation
- Static generation
- Use block buffering to prevent logging from slowing down site generation
- Write .nojekyll
- CLI
- Removed
-Cargument (orthogonal to Ema)
- Removed
- Helpers
- Helpers.FileSystem
- Add Union mount support; re-exported from
unionmountlibrary - enrich FileAction type to distinguish between existance and new and update states
- Add Union mount support; re-exported from
- Helpers.Tailwind
- add overflow-y-scroll to body
- Add twind shim before application's head
- CDN: Use latest version always.
- Helpers.Markdown
- add helpers to parse markdown;
parseMarkdownWithFrontMatterandparseMarkdown
- add helpers to parse markdown;
- Helpers.FileSystem
- Examples
Remove Ex03_Documentation.hs (moved to separate repo,Back to ./docs, but using Emanote.ema-docs)- Add Ex03_Basic.hs example
0.1.0.0 -- 2021-04-26
- First version. Released on an unsuspecting world.