Skip to content

Consider a zoneless policy #210

@dyladan

Description

@dyladan

I am proposing that the instrumentations developed by the browser SIG adopt a pure zoneless policy in favor of explicit and stack context propagation.

Steps

  1. Remove any implicit or explicit zone dependencies. Do not include it in any default browser bundles.
    • an implicit dependency would be any instrumentation that calls context.* API functions which assume there is an async context implementation available
  2. Internally, instrumentations should manually handle explicit context
  3. Instrumentations should use the synchronous StackContextManager to re-establish context at continuation boundaries. If the user has registered the zone context manager these will continue to work. It may be useful to publish a small helper library for common tasks like binding promises or event emitters.

Benefits

  • Reduced bundle size
  • Avoids zone.js patching and its overhead
  • Explicit re-entry points make context propagation easier to reason about and debug
  • Works in apps that cannot or will not include zone.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions