npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

az-zoneless

v0.0.7

Published

[![Known Vulnerabilities](https://snyk.io/test/github/ywarezk/zoneless/badge.svg)](https://snyk.io/test/github/ywarezk/zoneless) ![build](https://github.com/ywarezk/zoneless/actions/workflows/ci.yaml/badge.svg) [![codecov](https://codecov.io/gh/ywarezk/zo

Downloads

8

Readme

az-zoneless

Known Vulnerabilities build codecov npm version

A set of directive and utilities to manage an angular zoneless app.
Using this library you can go completly zoneless and still support 3rd party libraries like @angular/material.

This library will solve the following:

Warning: This package is experimental

Installation

npm i az-zoneless

In your AppModule add the ZonelessModule to the imports array.

import { ZonelessModule } from 'az-zoneless'

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...,
    ZonelessModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Set your app to be zoneless

This library is meant to be used in an angular running in zoneless mode.
To make angular work without Zone.js please do the following:

  1. from the polyfills.ts comment out the line where Zone.js is imported
// import 'zone.js';  // Included with Angular CLI.
  1. in the main.ts you need to tell angular to not work with Zone.js
platformBrowserDynamic()
  .bootstrapModule(AppModule, {
    ngZone: "noop",
  })
  .catch((err) => console.error(err));

Lecture about using angular in zoneless

Here is a lecture where I explain about angular in zoneless mode

Events

  1. After using the library, make sure to not use the regular events:
<!-- Do not use the regular events   -->
<button (click)="doSomething()"></button>

These events will still work but they are less performent.

  1. To improve performance and really take advantage of the fact that you are zoneless, please use the events like this:
<button (azClick)="doSomething()"></button>
  1. In case you do decide to run angular with Zone.js the library supplies you with an event that will run outside the angular zone.
<!-- the doSomething method will not trigger change detection and will run outside the angular zone -->
<button (azClick.zoneless)="doSomething()"></button>

Directives

If you are afraid to remove zone.js, we also supply with directives that will allow you to incrementally transition your app to be zoneless.
Instead of removing zone.js completly, you can run part of your component tree outside zone.js

azZoneLess

With this directive you can run part of your component tree outside zone.js.
This will work only if you did not remove Zone.js

<div>
  <h1>This part is inside zonejs</h1>
  <button (click)="doSomething()">
    clicking this will run change detection
  </button>

  <div *azZoneLess>
    <h1>This part is outside zonejs</h1>
    <button (click)="doSomething()">
      clicking this will run outside the zone and will only update is you call
      ChangeDetectorRef.detectChanges()
    </button>
  </div>
</div>

azZoneFull

If you used the azZoneLess you can go back to running in angular zone using the azZoneFull directive. This directive will only work if you did not remove Zone.js.

<div>
  <h1>This part is inside zonejs</h1>
  <button (click)="doSomething()">
    clicking this will run change detection
  </button>

  <div *azZoneLess>
    <h1>This part is outside zonejs</h1>
    <button (click)="doSomething()">
      clicking this will run outside the zone and will only update is you call
      ChangeDetectorRef.detectChanges()
    </button>

    <div *azZoneFull>
      <!-- This will return us back to the zone.js -->
      <button (click)="doSomething()">This runs in the zone.js</button>
    </div>
  </div>
</div>