Jacob Overgaard 4a504e8c95 Extensions: Adds @provideContext and @consumeContext decorators for a better developer experience (#20510)
* feat: adds first draft of a context consume decorator

* feat: uses an options pattern

* feat: changes approach to use `addInitializer` and `queueMicroTask` instead

* feat: adds extra warning if context is consumed on disconnected controllers

* feat: example implementation of consume decorator

* feat: adds support for 'subscribe'

* feat: initial work on provide decorator

* docs: adds license to consume decorator

* feat: adds support for umbraco controllers with `hostConnected`

* feat: uses asPromise to handle one-time subscription instead

* test: adds unit tests for consume decorator

* feat: adds support for controllers through hostConnected injection

* feat: adds support for controllers through hostConnected injection

* test: adds unit tests for provide decorator

* docs: adds more documentation around usage and adds a few warnings in console when it detects wrong usage

* feat: removes unused controllerMap

* docs: adds wording on standard vs legacy decorators

* docs: clarifies usage around internal state

* feat: adds proper return types for decorators

* docs: adds more types

* feat: makes element optional

* feat: makes element optional

* feat: uses @consume in the log viewer to showcase

* chore: cleans up debug info

* feat: renames to `consumeContext` and `provideContext` to stay inline with our own methods

* chore: removes unneeded typings

* chore: removes not needed check

* chore: removes not needed check

* test: adds test for rendered value

* feat: splits up code into several smaller functions

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* docs: augments code example for creating a context

* Update src/Umbraco.Web.UI.Client/src/packages/log-viewer/workspace/views/search/components/log-viewer-search-input.element.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-16 15:38:26 +01:00
2024-12-10 10:25:50 +01:00
2022-09-27 14:22:34 +02:00
2024-11-11 13:02:33 +01:00
2025-04-01 11:52:32 +02:00
2025-09-24 23:31:14 +02:00
2025-10-15 08:55:15 +02:00

Umbraco CMS

GitHub license NuGet Version Build status PRs Welcome Forum Chat about Umbraco on Discord Mastodon Follow

Umbraco is a free and open source .NET content management system. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.

Learn more at umbraco.com

Umbraco Logo

Looking to install Umbraco?

You can get started using the following commands on Windows, Linux and MacOS (after installing the .NET Runtime and SDK):

dotnet new install Umbraco.Templates
dotnet new umbraco --name MyProject
cd MyProject
dotnet run

Documentation

Our comprehensive documentation takes you from the fundamentals on how to start with Umbraco to deploying it to production.

Some important documentation links to get you started:

Get help

If you need a bit of feedback while building your Umbraco projects, we are chatty on Discord. Our Discord server serves as a social space for all Umbracians. If you have any questions or need some help with a problem, head over to our dedicated forum where the Umbraco Community will be happy to help.

Looking to contribute back to Umbraco?

You came to the right place! Our GitHub repository is available for all kinds of contributions:

Umbraco is contribution-focused and community-driven. If you want to contribute back to the Umbraco source code, please check out our guide to contributing.

Tip: You should not run Umbraco from source code found here. Umbraco is extremely extensible and can do whatever you need. Instead, install Umbraco as noted above and then extend it any way you want to.

Description
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
Readme 448 MiB
Languages
C# 59.5%
TypeScript 39.9%
JavaScript 0.3%
HTML 0.2%