Components: Web worker support

Created on 2 Oct 2016  路  11Comments  路  Source: angular/components

Bug, feature request, or proposal:

Proposal.

Please keep us informed about any progress towards making this library compatible with web workers, for those of us who wish to run our app within a web worker as seen in this sample app.

What is the use-case or motivation for changing an existing behavior?

To allow Material to be used in a multitude of environments, in high performance apps.

feature

Most helpful comment

Any update on this?

All 11 comments

Current plan is to support it once the WebWorker support in Angular core improves. In particular, Material needs custom renderers (to deal with marshalling between UI and worker threads).

However, it's not yet clear whether using web workers at all would actually be an improvement for the types on lower-level ui components that material offers; pretty much _all_ of the logic in the components deals with changing the rendered DOM in some way. Given that, it may end up being faster for material to continue running on the UI thread even when web-worker support is out of experimental.

@jelbourn didn't think of it that way. Perhaps what's needed is for Angular to facilitate a way to run MaterialModule on the UI thread, but the rest of the app on the worker thread. Sounds complicated.

My own use case for web workers is a smoother UI during start up. While the initial JS packages download and bootstrap, I have temporary content with animation:

<body>
  <ng-root-component>
       <!-- content & animation here to be removed by Angular after bootstrapping -->
  </ng-root-component>
</body>

Since the bootstrapping is occurring on the UI thread, the content and animation are frozen until Angular is ready, which defeats their purpose

@RoxKilly I have implemented a similiar "loading screen" feature using pure CSS. Maybe this might help you:

Live demo on http://temel.me/

@PascalTemel that is beautiful, thanks for sharing.

@PascalPrecht thanks for sharing. Mine is also Javascript-free; it doesn't require any external asset (CSS stylesheet or icons)

The issue I was addressing was that the UI animation is not smooth because it is run by the same thread that bootstraps Angular. So framerate drops while Angular loads. Running the app in a web worker should fix this

Closing this until a time when web-worker support in core is more solid.

Any update on this?

Is there any update on this?

Any update???

@jelbourn, this is now more solid????

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jelbourn picture jelbourn  路  3Comments

RoxKilly picture RoxKilly  路  3Comments

vanor89 picture vanor89  路  3Comments

vitaly-t picture vitaly-t  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments