Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Document event #2

Open
jirisykora83 opened this issue Jun 13, 2018 · 6 comments
Open

Expose Document event #2

jirisykora83 opened this issue Jun 13, 2018 · 6 comments
Assignees

Comments

@jirisykora83
Copy link

jirisykora83 commented Jun 13, 2018

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.

@galvesribeiro
Copy link
Member

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

Can you elaborate more on that?

Thank you.

@jirisykora83
Copy link
Author

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

@jirisykora83
Copy link
Author

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?

@galvesribeiro
Copy link
Member

@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.

@jirisykora83
Copy link
Author

@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 👍

@galvesribeiro
Copy link
Member

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

Stay tunned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants