Home icon indicating copy to clipboard operation
Home copied to clipboard

Expose Document event

Open jirisykora83 opened this issue 6 years ago • 6 comments

Propose In last public Blazor are available DOM event like (onMouseMove etc..). But at least what i know currently it is not possible to register same event over main Document DOM.

Use-case For example most of sliders use this. For example here

Some initial idea Having some class like Document or something. And provide extensions which map all (?) available events (maybe something more). And also it will be nice if we can register this extensions to Blazor app just with one single line like configure.AddBlazoreDocument() (which register class in DI and setup every necesery helpers).

Then in component simply use [Inject] private Document document { get; set; }

and let user use to consume this event in c# like normal c# events.

jirisykora83 avatar Jun 13 '18 18:06 jirisykora83

Sorry @jirisykora83, I don't quite understood your request.

Can you elaborate more on that?

Thank you.

galvesribeiro avatar Jun 13 '18 19:06 galvesribeiro

@galvesribeiro Yes of course. Sorry i publish the question before i actually finished :)

jirisykora83 avatar Jun 13 '18 19:06 jirisykora83

Also i am not user if it this function is fit to BlazorExtensions or it will be better have it build-in in Blazor what do you think?

jirisykora83 avatar Jun 13 '18 19:06 jirisykora83

@jirisykora83 sorry for taking so long to reply.

Maybe we can start a project for the Document APIs here. Do you want to implement it yourself?

I'm a really busy days recently and I'm not able to commit to implement it really soon.

The next thing on my queue is the SignalR client. If you want to commit to it, I can create the repo for you.

galvesribeiro avatar Jul 12 '18 13:07 galvesribeiro

@galvesribeiro Yes i know you are working on SignalR 👍

Whatever i make same investigation month ago (but i do not remember what exactly blocked me). But because last month Blazor was move to direction what i do not like (server side rendering, zero progress with AOT what is most important think from my point of view). I decided to move away from Blazor to TS-react 🤒 (at least until it will be really pre-production "ready").

For some context. I start working on new project with Blazor and i really like even if some things are not finish. But performance for any even little CPU hard task (parsing JSON, foreach over 800 strings etc..) are insane slow (i know it will be better after AOT but is checking mono on github last few month and it sens like nothing happen maybe they waiting for next WSAM version. I do not blame anyone, it is main fail i simple really like Blazor and maybe i hoped it will be ready soon.

Back to original propose i think we should wait at least for next Blazor version (because if i saw correctly they prepare new JS interop v3). Then i can look if it will be possible make at least some "prof-of-concept". But in the end i think it should be under main repo because most of Document DOM event share payload with DOM event so i guess in main repo is already some unify function work mapping it.

Thanks for your work around Blazor 👍

jirisykora83 avatar Jul 14 '18 09:07 jirisykora83

@jirisykora83 just to let you know. Two major perf improvements on Mono were merged Today that will directly affect blazor performance.

Stay tunned.

galvesribeiro avatar Jul 17 '18 01:07 galvesribeiro