ash_hq/priv/blog/published/2022-10-31-Testing.md
2022-11-01 03:20:09 -04:00

18 KiB
Raw Blame History

published_at state past_slugs slug title created_at id tag_line tag_names author body_html
2022-11-01 04:48:42.018361Z published
testing
Testing
ash-framework-2-0-release Ash Framework 2.0 Release 2022-10-31 21:51:07.394544Z f0d49295-a6c9-4a81-b6c6-babe7dded813 Say hello to the new Ash Framework blog! Posting the 2.0 announcement for posterity.
ash
release
elixir
Zach Daniel <div class="flex flex-row items-baseline"> <a href="#ash-framework"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h1 id="ash-framework"> Ash Framework </h1> </div> <div class="w-full flex justify-center"> <img src="/images/ash-logo-side.png" width="400" height="400"/></div> <div class="flex flex-row items-baseline"> <a href="#what-is-ash-"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="what-is-ash-"> What is Ash? </h2> </div> <p> Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can model anything, like a database table, an external API, or even custom code. Ash provides a rich, and extensive set of tools for interacting with and building on top of these resources. By modeling your application as a set of resources, other tools know exactly how to use them, allowing extensions like <code class="inline">AshGraphql</code> and <code class="inline">AshJsonApi</code> to provide top tier APIs with minimal configuration. With filtering/sorting/pagination/calculations/aggregations, pub/sub, policy authorization, rich introspection, and <em>much</em> more built-in, and a comprehensive suite of tools to allow you to build your own extensions, the possibilities are endless. </p> <p> For those familiar with Phoenix, you can think of Ash as a declarative application modeling layer designed to replace your Phoenix contexts.</p> <div class="flex flex-row items-baseline"> <a href="#ash-framework-2-0"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="ash-framework-2-0"> Ash Framework 2.0 </h2> </div> <p> Ash Framework 2.0 has been released! This begins the official stable release cycle (although it was already quite stable). Thanks to everyone in the community who helped make this possible, from the contributors, the curious, to those already using Ash in prod. Im eternally grateful for all of your support.</p> <p> Additionally, Id like to thank Alembic, who have brought me on to work on Ash full time. Alembic is building complex software with small teams in record time by leveraging tools like Ash Framework and Phoenix LiveView.</p> <p> Along with the 2.0 release of core, the <code class="inline">AshPostgres</code>, <code class="inline">AshPhoenix</code> and <code class="inline">AshArchival</code> packages have had 1.0 version released as well. <code class="inline">AshGraphql</code> is next up, and should be released in the next few weeks. Feel free to dive in to it before then, though :).</p> <div class="flex flex-row items-baseline"> <a href="#is-ash-an-alternative-to-x-"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="is-ash-an-alternative-to-x-"> Is Ash an alternative to X? </h2> </div> <p> Ash is not meant to be an alternative to Phoenix, Ecto, or Absinthe. Ash uses Ecto under the hood, <code class="inline">AshGraphql</code> uses Absinthe. Phoenix is absolutely the recommended way to build web interfaces on top of your Ash application (there is a whole package dedicated to it, <code class="inline">AshPhoenix</code>). Ash is not meant to be the only way that you ever interact with your data, so it is almost a certainty that you will need to use <code class="inline">Ecto</code> in some cases. For instance, Ash does not currently support bulk actions or atomic updates. For this reason, you can implement custom actions for things that can be encapsulated in your resource, and you have all of Elixir at your disposal to implement custom behavior outside of your resources, with a wide array of escape hatches in between.</p> <div class="flex flex-row items-baseline"> <a href="#extensions"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="extensions"> Extensions </h2> </div> <div class="flex flex-row items-baseline"> <a href="#extensions-in-1-0-"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h3 id="extensions-in-1-0-"> Extensions in 1.0+ </h3> </div> <ul> <li> <code class="inline">AshPostgres</code> - Back a resource with postgres. Rich querying capabilities, supporting aggregates, calculations, and fragments. Comes with a migration generator to get you up and running in record time! </li> <li> <code class="inline">AshPhoenix</code> - Helpers to integrate Ash Resources with Phoenix. Tools like <code class="inline">AshPhoenix.Form</code> allow you to build forms over your resources, and manage complex nested related data with one data structure. </li> <li> <code class="inline">AshArchival</code> - A tiny but powerful extension. Get archival (A.K.A soft deletion) with one line of code. </li> </ul> <div class="flex flex-row items-baseline"> <a href="#extensions--1-0"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h3 id="extensions--1-0"> Extensions <1.0 </h3> </div> <ul> <li> <code class="inline">AshGraphql</code> - Create a GraphQL from your resources with only a few lines of code. Backed by the excellent Absinthe library. It comes with its own fully implemented dataloader, and automatically derives all the types, fields, and mutations automatically. Getting a relay compatible GraphQL API is as easy as setting the <code class="inline">relay?</code> toggle. </li> </ul> <ul> <li> <code class="inline">AshJsonApi</code> - Create a JSON:API spec compliant API in minutes. </li> <li> <code class="inline">AshAdmin</code> - A rich admin UI automatically derived from your resource definitions. </li> <li> <code class="inline">AshCsv</code> - Back your resource with a CSV file. </li> <li> <code class="inline">Spark</code> - The core declarative DSL library that backs Ash and its extensions. </li> </ul> <div class="flex flex-row items-baseline"> <a href="#unreleased-extensions"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h3 id="unreleased-extensions"> Unreleased Extensions </h3> </div> <ul> <li> <code class="inline">AshPaperTrail</code> - Creates and manages a versions table for a resource, and writes all changes to that version resource. With one line of code. </li> <li> <code class="inline">AshJsonApiWrapper</code> - Back your resource with an external API using finch and configuration to describe how your resource maps to the response from the external service. </li> </ul> <div class="flex flex-row items-baseline"> <a href="#your-own-extensions"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h3 id="your-own-extensions"> Your Own Extensions </h3> </div> <p> All of the extensions above are created with a set of tools that are free to use to create your own extensions. They can all be used as a basis point, or as inspiration. Many users have created their own extensions for various reasons. An extension can both add to the resources DSL and programatically restructure the resource. For example, <code class="inline">AshArchival</code> adds an attribute, modifies every destroy action, and adds a “base filter” to the resource. This allows for extremely powerful extensions.</p> <div class="flex flex-row items-baseline"> <a href="#links"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="links"> Links </h2> </div> <ul> <li> New and improved docs: <a href="https://ash-hq.org">https://ash-hq.org</a>! </li> <li> Office hours/Q&A release livestream: <a href="https://www.youtube.com/watch?v=BchANMO1f8s">https://www.youtube.com/watch?v=BchANMO1f8s</a> </li> <li> Official discord Server: <a href="https://discord.gg/D7FNG2q">https://discord.gg/D7FNG2q</a> </li> <li> Sponsors Dashboard: <a href="https://github.com/sponsors/zachdaniel/">https://github.com/sponsors/zachdaniel/</a> </li> <li> Ash Framework Twitter: <a href="https://twitter.com/AshFramework">https://twitter.com/AshFramework</a> </li> <li> Source: <a href="https://github.com/ash-project">https://github.com/ash-project</a> </li> <li> Roadmap: <a href="https://github.com/orgs/ash-project/projects/3">https://github.com/orgs/ash-project/projects/3</a> </li> <li> Alembic: <a href="https://alembic.com.au/">https://alembic.com.au/</a> </li> </ul> <p> Expect to see a lot more content before long, like tutorial and short, topical videos.</p> <div class="flex flex-row items-baseline"> <a href="#elixir-forum"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="elixir-forum"> Elixir Forum </h2> </div> <p> Up until now, I havent posted much here, and have primarily engaged with the community via twitter and discord. However, if there are users here on the forums who are interested, Im more than happy to answer questions here. For now, Ill be subscribed to the #ash tag, so if you use that, Ill be notified.</p> <div class="flex flex-row items-baseline"> <a href="#where-to-start-"> <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"> </path> </svg> </a> <h2 id="where-to-start-"> Where to start? </h2> </div> <p> Ash is quite broad, and covers a considerable amount of ground. My suggestion is to follow the tutorials for a kicking off point. There are getting started guides for each individual package as well that, combined, will get you up and running from scratch.</p> <p> 😎 Happy hacking! 😎</p>

Ash Framework

What is Ash?

Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can model anything, like a database table, an external API, or even custom code. Ash provides a rich, and extensive set of tools for interacting with and building on top of these resources. By modeling your application as a set of resources, other tools know exactly how to use them, allowing extensions like AshGraphql and AshJsonApi to provide top tier APIs with minimal configuration. With filtering/sorting/pagination/calculations/aggregations, pub/sub, policy authorization, rich introspection, and much more built-in, and a comprehensive suite of tools to allow you to build your own extensions, the possibilities are endless.

For those familiar with Phoenix, you can think of Ash as a declarative application modeling layer designed to replace your Phoenix contexts.

Ash Framework 2.0

Ash Framework 2.0 has been released! This begins the official stable release cycle (although it was already quite stable). Thanks to everyone in the community who helped make this possible, from the contributors, the curious, to those already using Ash in prod. I'm eternally grateful for all of your support.

Additionally, I'd like to thank Alembic, who have brought me on to work on Ash full time. Alembic is building complex software with small teams in record time by leveraging tools like Ash Framework and Phoenix LiveView.

Along with the 2.0 release of core, the AshPostgres, AshPhoenix and AshArchival packages have had 1.0 version released as well. AshGraphql is next up, and should be released in the next few weeks. Feel free to dive in to it before then, though :).

Is Ash an alternative to X?

Ash is not meant to be an alternative to Phoenix, Ecto, or Absinthe. Ash uses Ecto under the hood, AshGraphql uses Absinthe. Phoenix is absolutely the recommended way to build web interfaces on top of your Ash application (there is a whole package dedicated to it, AshPhoenix). Ash is not meant to be the only way that you ever interact with your data, so it is almost a certainty that you will need to use Ecto in some cases. For instance, Ash does not currently support bulk actions or atomic updates. For this reason, you can implement custom actions for things that can be encapsulated in your resource, and you have all of Elixir at your disposal to implement custom behavior outside of your resources, with a wide array of escape hatches in between.

Extensions

Extensions in 1.0+

  • AshPostgres - Back a resource with postgres. Rich querying capabilities, supporting aggregates, calculations, and fragments. Comes with a migration generator to get you up and running in record time!
  • AshPhoenix - Helpers to integrate Ash Resources with Phoenix. Tools like AshPhoenix.Form allow you to build forms over your resources, and manage complex nested related data with one data structure.
  • AshArchival - A tiny but powerful extension. Get archival (A.K.A soft deletion) with one line of code.

Extensions <1.0

  • AshGraphql - Create a GraphQL from your resources with only a few lines of code. Backed by the excellent Absinthe library. It comes with its own fully implemented dataloader, and automatically derives all the types, fields, and mutations automatically. Getting a relay compatible GraphQL API is as easy as setting the relay? toggle.
  • AshJsonApi - Create a JSON:API spec compliant API in minutes.
  • AshAdmin - A rich admin UI automatically derived from your resource definitions.
  • AshCsv - Back your resource with a CSV file.
  • Spark - The core declarative DSL library that backs Ash and its extensions.

Unreleased Extensions

  • AshPaperTrail - Creates and manages a versions table for a resource, and writes all changes to that version resource. With one line of code.
  • AshJsonApiWrapper - Back your resource with an external API using finch and configuration to describe how your resource maps to the response from the external service.

Your Own Extensions

All of the extensions above are created with a set of tools that are free to use to create your own extensions. They can all be used as a basis point, or as inspiration. Many users have created their own extensions for various reasons. An extension can both add to the resource's DSL and programatically restructure the resource. For example, AshArchival adds an attribute, modifies every destroy action, and adds a "base filter" to the resource. This allows for extremely powerful extensions.

Expect to see a lot more content before long, like tutorial and short, topical videos.

Elixir Forum

Up until now, I haven't posted much here, and have primarily engaged with the community via twitter and discord. However, if there are users here on the forums who are interested, I'm more than happy to answer questions here. For now, I'll be subscribed to the #ash tag, so if you use that, I'll be notified.

Where to start?

Ash is quite broad, and covers a considerable amount of ground. My suggestion is to follow the tutorials for a kicking off point. There are getting started guides for each individual package as well that, combined, will get you up and running from scratch.

😎 Happy hacking! 😎