Export/Expose Lit "Task" #17042
Replies: 3 comments 6 replies
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
-
I think you should be able to install During the development of 14.0, we discovered that we weren't compatible with lit/task at all due to the way our controllers worked. We are not using Lit's controller system and our methods collided with theirs. We fixed that shortly before release to ensure that anyone should be able to use the newer stuff coming out of the Lit Labs. Please let us know how you fare with this and if you hit any obstacles! |
Beta Was this translation helpful? Give feedback.
-
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
14.2.0
Bug summary
As a backoffice developer I would like to be able to use Lit's "Task" class without having to install Lit in my project along side umbraco-cms/backoffice.
Specifics
If I have a backoffice component that needs to do some async work, such as calling an API, I would like to leverage the Lit "Task" functionality described in https://lit.dev/docs/data/task/
However that article suggests an import statement
import {Task} from '@lit/task';
Assuming I am only using the umbraco-cms/backoffice package, I need some other import statement such as
import {Task} from '@umbraco-cms/backoffice/lit/task';
but that isn't a valid import path. Since the backoffice uses lit should we have some access to some of its primary classes too?Would it be possible to expose Lit's "Task" through the umbraco backoffice package somehow?
It is possible this is just my naivety concerning typescript and packages, if so, a reply on https://our.umbraco.com/forum/using-umbraco-and-getting-started/114569-v14-javascript-question-calling-async-function-from-inside-render-section-just-displays-object-promise might help.
Steps to reproduce
Install the backoffice front-end library (@umbraco-cms/backoffice) then try to write an extension using typescript that does some async work using Lit "Task"
Expected result / actual result
I would like to be able to import "Task" from somewhere, instead I cannot write a valid import statement.
Beta Was this translation helpful? Give feedback.
All reactions