Skip to content

Releases: brandocms/brando

v0.53.0

07 May 14:23
Compare
Choose a tag to compare

Intermediary release to further separate 0.54's upgrade path. This is the final release before transitioning blocks from polymorphic embeds to assocs in 0.54.

Changelog

  • BREAKING: Switch out import Phoenix.LiveView.Helpers with import Phoenix.Component

  • Upgrade deps:

    {:phoenix_live_view, "~> 0.20"},
    {:phoenix_live_dashboard, "~> 0.8"},
    
  • BREAKING: If you upgrade to Vite 3, they suddenly output admin/main.css instead of admin/admin.css.
    To fix, edit your assets/backend/vite.config.js and replace manifest: false
    with manifest: 'admin_manifest.json. You can also add in a hash since we now use a manifest:

    entryFileNames: `assets/admin/admin-[hash].js`,
    chunkFileNames: `assets/admin/__[name]-[hash].js`,
    assetFileNames: `assets/admin/admin-[hash].[ext]`
    
  • BREAKING: Svelte's Vite plugin is requiring type = module now so there are some changes to do:

    • Upgrade Vite + plugins > 4
    • Set assets/backend/package.json type to module -> "type": "module"
    • Rename assets/backend/postcss.config.js to assets/backend/postcss.config.cjs
    • Rename assets/backend/europa.config.js to assets/backend/europa.config.cjs
    • Upgrade assets/backend europacss to > 0.12
  • BREAKING: Updated Sentry to 10.x. Add to your Dockerfile before mix release:

    RUN mix sentry.package_source_code
    RUN mix release

    Then remove the included_environments key from the :sentry config in config/prod.exs``� and copy the sentry cfg to other env configs you might want to enable sentry on, for instance config/staging.exs`.

  • BREAKING: Change Presence module — in your lib/my_app/presence.ex:

    use BrandoAdmin.Presence,
    otp_app: :my_app,
    pubsub_server: MyApp.PubSub,
    presence: MODULE

  • To enable presence in your update forms, add presences={@presences} to your
    Form live components in update views:

    <.live_component module={Form}
      id="page_form"
      entry_id={@entry_id}
      current_user={@current_user}
      presences={@presences}
      schema={@schema}>
      <:header>
        <%= gettext("Edit page") %>
      </:header>
    </.live_component>
    
  • BREAKING: Replace <%= csrf_meta_tag %> with ´<.csrf_meta_tag />`

  • BREAKING: Switch out <%= google_analytics(...) %> calls in your code with
    `<.google_analytics code="...." />

  • BREAKING: Dropped use Phoenix.HTML so your error_tag in error_helpers.ex won't
    work anymore. Check out https://github.com/phoenixframework/phoenix/blob/main/installer/templates/phx_web/components/core_components.ex for how to implement errors in the frontend.

  • BREAKING: If updating frontend to Vite 5, you need to explicitly set the manifest path.
    So change manifest: true, to manifest: 'manifest.json'

  • BREAKING: Rewritten :entries (related entries). Now stores identifiers in a table and
    references this table for related entries.

    Blueprint setup is same as before:

    relation :related_entries, :entries, constraints: [max_length: 3]
    

    and form setup:

    input :related_entries, :entries,
      label: t("Related entries"),
      for: [{__MODULE__, %{preload: [], order: "asc title", status: :published}}],
      filter_language: true
    
  • BREAKING: Datasources — selection list callback should return identifiers
    instead of entries, and the select callback itself receives identifiers as the
    sole argument:

    selection :featured, 
      fn schema, language, _vars ->
        Brando.Content.list_identifiers(schema, %{language: language})
      end,
      fn identifiers ->
        entry_ids = Enum.map(identifiers, & &1.entry_id)
    
        results =
          from t in __MODULE__,
            where: t.id in ^entry_ids,
            order_by: fragment("array_position(?, ?)", ^entry_ids, t.id)
    
        {:ok, MyApp.Repo.all(results)}
      end
  • BREAKING: Updated mix brando.upgrade script. Copy the new script into
    your application:

    $ cp deps/brando/priv/templates/brando.install/lib/mix/brando.upgrade.ex lib/mix/brando.upgrade.ex
  • BREAKING: Deprecated :many_to_many for now. This might return later if
    there's a usecase for it. Right now it is replaced by :has_many through
    associations instead.

    Before:

    relation :contributors, :many_to_many,
      module: Articles.Contributor,
      join_through: Articles.ArticleContributor,
      on_replace: :delete,
      cast: true

    After:

    relation :article_contributors, :has_many,
      module: Articles.ArticleContributor,
      preload_order: [asc: :sequence],
      on_replace: :delete_if_exists,
      cast: true
    
    relation :contributors, :has_many,
      module: Articles.Contributor,
      through: [:article_contributors, :contributor]

    If you use the ArticleContributor schema for a multi select, you must
    add @allow_mark_as_deleted true to this schema. Also you need to add a
    relation_key to the input declaration:

    input :article_contributors, :multi_select,
      options: &__MODULE__.get_contributors/2,
      relation_key: :contributor_id,
      resetable: true,
      label: t("Contributors")
  • BREAKING: ErrorView is now ErrorHTML. If you are using Brando's error
    templates, you must swap your endpoint's render_errors key with:

    config :my_app, MyApp.Endpoint,
      render_errors: [
        formats: [html: Brando.ErrorHTML, json: Brando.ErrorJSON], layout: false
      ]

    Also switch out the view in your fallback_controller.ex:

    |> put_view(html: <%= application_module %>Web.ErrorHTML)
  • BREAKING: Add delete_selected as a built-in action for listing selections.
    This means you should remove your own delete_selected from your listing's
    selection_actions

  • BREAKING: Added default actions for listings:

    • edit
    • delete
    • duplicate

    This means you should remove these from your listings (unless you want them doubled)

  • BREAKING: @identity now refers to the current language identity, instead
    of a map of all languages

  • BREAKING: Remove datasource block and introduce module blocks with
    datasource instead. Run mix brando.upgrade && mix ecto.migrate
    to convert your existing datasource blocks to module blocks.

  • BREAKING: Admin now reads JS and CSS from priv/static/admin_manifest.json.
    Make sure to set this in assets/backend/vite.config.js to:
    manifest: 'admin_manifest.json

  • BREAKING: CDN config is now per asset module, so instead of

    config :brando, Brando.CDN, #...
    

    add

    config :brando, Brando.Images, cdn: [enabled: false]
    config :brando, Brando.Files, cdn: [enabled: true, ...]
  • BREAKING: Switch out your <%= live_patch gettext("Create new") ... calls
    in your list views. Replace with

    <.link navigate={@admin_create_url} class="primary">
      <%= gettext("Create new") %>
    </.link>
  • BREAKING: With moving to Phoenix 1.7+, we've tossed out Phoenix.View from
    Brando and use the new embed_templates setup instead. If your app depends
    on Phoenix.View, then you must add it as a dependency:

    {:phoenix_view, "~> 2.0"},
    

    You can use a prefab'ed MyAppWeb setup by replacing your use MyAppWeb, :controller (etc)
    with use BrandoWeb, :controller (etc). You can also use

    use BrandoWeb, :legacy_controller

    for utilizing the new layouts setup, but use regular template views.

    Convert your layout templates to heex, rename the layout view to
    MyAppWeb.Layouts, move it to my_app_web/components/layouts.ex and add

    use BrandoWeb, :html
    
    embed_templates "components/layouts/*"
    embed_templates "components/partials/*"

    Move your partials from templates/page into components/partials,
    rename them to drop the leading _ and reference them in your app.html.heex
    layout as <.navigation {assigns} />, <.footer {assigns} /> etc.

  • BREAKING: Update your live_preview.ex to the new format for setting layout
    and template:

    Old:

    layout_module MyAppWeb.ProjectView
    layout_template "app.html"
    view_module MyAppWeb.ProjectView
    view_template "detail.html"

    New (for Phoenix.Template integrations):

    layout {MyAppWeb.Layouts, :app}
    template {MyAppWeb.ProjectHTML, "detail"}
    # or
    template fn e -> {MyAppWeb.ProjectHTML, e.template} end

    New (for Phoenix.View integrations):

    layout {MyAppWeb.LayoutView, "app.html"}
    template {MyAppWeb.ProjectView, "detail.html"}
    # or
    template fn e -> {MyAppWeb.ProjectView, e.template} end
  • Use Finch for emails:

    • Add finch as a dep to your mix.exs:
    {:finch, "~> 0.13"},
    • Add to your config:
    config :swoosh, :api_client, MyApp.Finch
    • Add to your application supervisor in lib/my_app/application.ex
      children = [
        # Start the Ecto repository
        MyApp.Repo,
        # Start the Telemetry supervisor
        MyAppWeb.Telemetry,
        # Start the PubSub system
        {Phoenix.PubSub, name: MyApp.PubSub},
        # Start Finch
    +   {Finch, name: MyApp.Finch},
        # Start the Endpoint (http/https)
        MyAppWeb.Endpoint,
        # Start the Presence system
        MyApp.Presence,
        # Start the Brando supervisor
        Brando
        # Start a worker by calling: MyApp.Worker.start_link(arg)
        # {MyApp.Worker, arg},
      ]
    
  • Add :preview_expiry_days config. Default is two days.
    I.e config :brando, :preview_expiry_days, 31

  • Add alternate entries

  • Add default actions to listing rows: edit, delete, duplicate

  • Add select var type

  • Add video_file_options/1 callback to Villain parser. Return a k...

Read more

v0.52.0

27 May 22:02
Compare
Choose a tag to compare
  • First LV version
  • Config: Add admin_module: MyAppAdmin to your config/brando.exs
  • Trait.changeset_mutator/4 is now Trait.changeset_mutator/5. It receives
    some additional opts from changeset, that normally would not be touched.
  • Page properties are now page vars. get_prop -> get_var
  • render_sections_css -> render_palettes_css
  • Added input :gallery
  • Added input :color
  • Allow setting additional app specific cron jobs with
    config :my_app,
      cron_jobs: [
        {"0 0 * * *", MyApp.Worker.RefreshFrontpage}
      ]
    
  • Added Brando.Plug.Media

v0.51.0

17 Nov 22:15
v0.51.0
8be5e01
Compare
Choose a tag to compare
  • NOTE: This will be the final GraphQL/Vue version. Next version will be with LiveViews!
  • Vite: Respect hmr config setting. Set it to true in your dev.exs, and false in prod.exs
  • Query: Add mutation :duplicate
  • Images: Add dominant_color to image struct.
  • Revisions: Adds initial revision support.
  • Publisher: Add Oban job support for scheduled publishing
  • Pagination: Add pagination: true to generate pagination meta for list queries
  • SSG: Add barebones start
  • Villain: Replace $timestamp in Villain HTML
  • Villain: Added localized date filter
  • Router: Add Brando.Plug.Fragment to assign a map of fragments to you connection:
    plug Brando.Plug.Fragment, parent_key: "partials", as: :partials
    

v0.50.0

06 Mar 18:57
v0.50.0
49508dc
Compare
Choose a tag to compare
  • Query: Add get_<schema>! version that raises on no result
  • Query: Add insert/update/delete mutations. See UPGRADE.md
  • Query: Add cache to get_*
  • Query: Add joined order_by:
    {:ok, posts} = list_posts(%{order: [{:asc, {:comments, :title}]})
  • Soft Delete: Add cron job to check for expired soft deleted entries
  • Villain: Removed markdown parsing from Text blocks.
  • Villain: Refactored templates as modules, see UPGRADE.md
  • Villain: Add {% hide %} tag for hiding content only in the Villain Editor.
  • Router: Add admin_routes/0 and page_routes/0
  • Router: Add :put_extra_secure_browser_headers
  • Frontend: Add Vite tooling, see UPGRADE.md
  • Releases: Improved ReleaseTasks -- works better with Elixir releases

v0.49.0

23 Nov 15:01
v0.49.0
0979377
Compare
Choose a tag to compare
  • BREAKING: Removed mogrify/imagemagick -- use sharp-cli/sharp instead.
  • Move to mix releases from Distillery for new project template.
  • Add webp processing to png and jpeg assets. Falls back to png/jpeg
    if browser does not support webp.
  • Add ?vsn=d to all fonts.pcss URLs to fix fonts not caching.
  • Dynamic redirects.
  • Live preview: Changed syntax - see UPGRADE.md
  • Live preview: Now sends entry diffs on update to save some bandwidth
  • Live preview: Send base64 of images on entry creation
  • Villain: Added telemetry for parse_and_render
  • Try to rotate images by EXIF info on upload
  • Add system startup warnings to Brando JS
  • Better Villain template authoring experience
  • Add Brando.HTML.preload_fonts/1

v0.48.0

27 Oct 18:28
v0.48.0
b6b6fe9
Compare
Choose a tag to compare
  • Switch to Liquex.
    {% for item <- entry.items %} -> {% for item in entry.items %}
    ${global:category_key.global_key} -> {{ globals.category_key.global_key }}
    ${menu:main.en} -> {{ navigation.main.en }}

    Brando checks for old syntax and warns on system startup.

  • Villain: Allow undeleting refs in template blocks

  • BrandoJS/config: allow templates config to be a function. Gets called with page

  • Add Brando.Type.Video with corresponding KInputVideo

  • Cache navigation menus

  • Add Query cache. Page.list_pages(%{status: :published, cache: true})

  • Add sizes: "auto" to picture_tag

  • Removed Brando.Registry and old i18n logic

  • English translations for BrandoJS

  • Set image meta editing as default true on Image fields in BrandoJS

  • Inject --aspect-ratio css var for video_tag

  • Add address2 and address3 in Identity for extra address lines

  • Add navigation to villain templates context

  • Optimized sequencing query. Now only performs a single query

  • Add cache option to Brando.Query list functions

v0.47.0

27 Sep 20:46
v0.47.0
a4ea7d4
Compare
Choose a tag to compare
  • Add page properties.
  • Fix ordering of translation fragments
  • Fix lightbox src with lazyload in picture_tag
  • Rerender matching templates in Villains when updating globals or identity
  • Add render_caption callback to Villain parser. Picture blocks call this to render captions.
  • Set fehn 3.0 as default Docker image (Ubuntu 20.04)
  • Allow parsing RFC 3339z datetime strings in date filter
  • Add sitemap logic, Brando.Sitemap.
  • Add oban for cron jobs.
  • Add orientation filter
  • Dynamic navigation V1
  • Cleaned up Brando.Pages.get_page/* functions
  • Added publish_at logic to pages.
  • Use imageType fragment in generator
  • Add select logic to Brando.Query
  • Fix nonstandard module naming bugs in generator (NNCA would become Nnca etc)