惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News | PayPal Newsroom
Application and Cybersecurity Blog
Application and Cybersecurity Blog
O
OpenAI News
S
Security @ Cisco Blogs
宝玉的分享
宝玉的分享
Hacker News: Ask HN
Hacker News: Ask HN
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
TaoSecurity Blog
TaoSecurity Blog
Help Net Security
Help Net Security
Latest news
Latest news
NISL@THU
NISL@THU
S
Security Affairs
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
AI
AI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
小众软件
小众软件
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
AWS News Blog
AWS News Blog
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
I
InfoQ
Schneier on Security
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
The Exploit Database - CXSecurity.com
IT之家
IT之家
T
Threatpost
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
腾讯CDC
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
News and Events Feed by Topic
L
LINUX DO - 最新话题
F
Full Disclosure
大猫的无限游戏
大猫的无限游戏
H
Heimdal Security Blog
S
SegmentFault 最新的问题

Minko Gechev's blog

skillgrade Unit Tests for AI Agent Skills You Should Care About AI Generative Development LLM-first Web Framework Reactive framework in ~200 lines of JavaScript Managing Angular Are LLMs going to replace us? Prefetching Heuristics Design Patterns in Open Source Projects - Part II Design Patterns in Open Source Projects - Part I What I learned doing 125 public talks - Part I Dynamic imports solve all the problems, right? 5 Angular CLI Features You Didn't Know About Angular quicklink Preloading Strategy Introducing Bazel Schematics for Angular CLI Building TypeScript Projects with Bazel Joining Google Playing Mortal Kombat with TensorFlow.js. Transfer learning and data augmentation Fast, extensible, configurable, and beautiful linter for Go Introducing Guess.js - a toolkit for enabling data-driven user-experiences on the Web Machine Learning-Driven Bundling. The Future of JavaScript Tooling. JavaScript Decorators for Declarative and Readable Code 3 Tricks For Using Redux and Immutable.js with TypeScript Follow Your Dream Career with Open Source. Personal Story. Redux Anti-Patterns - Part 1. State Management. Faster Angular Applications - Understanding Differs. Developing a Custom IterableDiffer Faster Angular Applications - Part 2. Pure Pipes, Pure Functions and Memoization Faster Angular Applications - Part 1. On Push Change Detection and Immutability Understanding Dynamic Scoping and TemplateRef Implementing a Simple Compiler on 25 Lines of JavaScript Developing Statically Typed Programming Language WebVR for a Gamified IDE 7 Angular Tools That You Should Consider Implementing Angular's Dependency Injection in React. Understanding Element Injectors. Distributing an Angular Library - The Brief Guide Angular in Production Ahead-of-Time Compilation in Angular 2.5X Smaller Angular 2 Applications with Google Closure Compiler Using Stripe with Angular (Deprecated) Building an Angular Application for Production Implementing the Missing "resolve" Feature of the Angular 2 Router Scalable Single-Page Application Architecture Managing ambient type definitions and dealing with the "Duplicate identifier" TypeScript error Static Code Analysis of Angular 2 and TypeScript Projects Enforcing Best Practices with Static Code Analysis of Angular 2 Projects ViewChildren and ContentChildren in Angular Dynamically Configuring the Angular's Router Angular 2 Hot Loader Lazy Loading of Route Components in Angular 2 Aspect-Oriented Programming in JavaScript Flux in Depth. Store and Network Communication. Using JSX with TypeScript Flux in Depth. Overview and Components. Even Faster AngularJS Data Structures Boost the Performance of an AngularJS Application Using Immutable Data - Part 2 Angular2 - First Impressions Build Your own Simplified AngularJS in 200 Lines of JavaScript Persistent State of ReactJS Component Boost the Performance of an AngularJS Application Using Immutable Data Processing Binary Protocols with Client-Side JavaScript Stream your Desktop to HTML5 Video Element Multi-User Video Conference with WebRTC Asynchronous calls with ES6 generators Binary Tree iterator with ES6 generators WebRTC chat with React.js AngularJS in Patterns (Part 3) AngularJS in Patterns (Part 2). Services. Using GitHub Pages with Jekyll! AngularJS in Patterns (Part 1). Overview of AngularJS Singleton in JavaScript Express over HTTPS What I get from the JavaScript MV* frameworks Remote Desktop Client with AngularJS and Yeoman The magic of $resource (or simply a client-side Active Record) AngularJS Inheritance Patterns AngularAOP v0.1.0 Advanced JavaScript at Sofia University AngularJS style guide Lazy prefetching of AngularJS partials VNC client on 200 lines of JavaScript Aspect-Oriented Programming with AngularJS CSS3 flipping effect Practical programming with JavaScript Why I should use publish/subscribe in JavaScript JavaScript, the weird parts Functional programming with JavaScript plainvm Looking for performance? Probably you should NOT use [].sort (V8) JavaScript image scaling ELang Caching CSS with localStorage Self-invoking functions in JavaScript (or Immediately Invoked Function Expressions) Asus N56VZ + Ubuntu 12.04 (en) Asus N56VZ + Ubuntu 12.04 Debian Squeeze + LXDE on Google Nexus S (or having some fun while suffering) HTML5 image editor Курсови проекти – ФМИ Carousel Gallery SofiaJS...
Announcing ngrev - Reverse Engineering Tool for Angular
2017-04-09 · via Minko Gechev's blog

Have you ever been hired to work on a huge legacy Angular project with thousands of NgModules, components, directives, pipes and services? Neither do I. Angular (2 and above) is still relatively new framework and there are not many enormous projects out there. On the other hand, Angular is powerful and in combination with TypeScript we can build big, enterprise applications.

Exploring an Application

It’s hard to start digging into a large codebase without being aware of the overall structure of the project. We can very easily get trapped and start digging into details without first getting familiar with the core abstractions of the application.

In the past, when I had to deal with Java code Visual Paradigm was my favorite tool to start with. It can generate diagrams from our source code. Navigating through these diagrams we can jump between different levels of abstractions and explore the individual components on each layer. This way we can get the overall picture much easier since most of the details at this point are well abstracted - each class is represented as a box. In contrast, when we start reading each individual source file, we need to deal with a lot of details - properties, decorators, comments, methods…

Performance Analysis

Deeply understanding our codebase can help us optimize our application in terms of bundle size or even runtime performance. Imagine we have a huge Angular app encapsulated in a large bundle.

It’ll be very obvious where the different split points of the lazy loaded modules should be once we represent the structure of the individual symbols graphically. This way we can explore on different levels of abstraction how the modules relate and depend on each other, and respectively find out how we can introduce the minimal functionality required by the initial bootstrap. Later, recursively, we can apply the same strategy for the rest of the module tree.

Now let’s suppose that the runtime performance of our application suffers. Clustering the bindings by component and representing them graphically can make it so obvious what’s wrong and where we should spend extra effort in optimizations.

https://t.co/gqqMjqn4up @mgechev this is just amazing 😲 deeply *understanding* applications is going to enable deep deep perf optimizations

— Rob Wormald (@robwormald) April 9, 2017

Introducing ngrev

For a while, I’ve been doing static code analysis for Angular apps. My purpose for the last a couple of months was style checking with codelyzer. A few weeks ago, I decided to reuse some of the modules I already built and developed a project which provides visualization and navigation through the structure of a project.

This is how ended up developing ngrev. ngrev is an Electron application which uses the tooling I built around codelyzer on top of the Angular compiler. In case your application is compatible with Angular’s Ahead-of-Time compiler ngast can parse your entire codebase and return an abstract representation of it. Later, ngrev will render this abstract representation onto the screen, letting you to navigate between the different levels of abstraction of your project. This can be on level modules, providers, components, templates, etc.

“A picture is worth a thousand words”, right? Then a 65 seconds video running with 60 fps is worth 3,900,000 words. Instead of keep talking about what ngrev is and how it works, you can just take a look at the video below:

Core Features

Some of the core features of the project are:

  • Visual presentation of the modules of the application and their relations.
  • Representation of the individual directives, components, providers, pipes and their dependencies.
  • Visualization of the components’ templates.
  • “Peek at the code” feature which allows you to open the source file where given symbol is declared in our favorite editor.
  • etc.

The project right now has some limitations which are not show stoppers and are relatively easy to overcome:

  • No support for lazy loaded modules (ngast has support for them so the implementation will be trivial).
  • No support for navigation through the components’ providers and viewProviders`.

How to get involved?

There’s place for plenty of additional features that we can introduce including (but not limited to):

  • Visual suggestions for runtime optimizations.
  • Visual suggestions for split points.
  • Highlighting of complex templates.
  • etc…

I’d love to chat about how to make this project even more useful! In the “About” section you can find my email and reach me out.

How to use?

macOS

  1. Go to the releases page.
  2. Download the latest .dmg file.
  3. Install the application.

Linux

  1. Go to the releases page.
  2. Download the latest .AppImage file.
  3. Run the .AppImage file (you may need to chmod +x .AppImage).

Windows

  1. Go to the releases page.
  2. Download the latest .exe file.
  3. Install the application.

Application Requirements

Your application needs to be compatible with the Angular’s AoT compiler (i.e. you should be able to compile it with ngc).

Using with Angular CLI

  1. Open the Angular’s application directory.
  2. Make sure the dependencies are installed.
  3. Open ngrev.
  4. Click on Select Project and select [YOUR_CLI_APP]/src/tsconfig.app.json.

Using with Angular Seed

  1. Open the Angular’s application directory.
  2. Make sure the dependencies are installed.
  3. Open ngrev.
  4. Click on Select Project and select [YOUR_CLI_APP]/src/client/tsconfig.json.

Conclusion

Thanks to the fact that Angular is developed with tooling in mind we can build amazing development tools which can dramatically improve our experience and help us build more performant & smaller applications faster!

This blog post was introduction to only one such tool which illustrates this practically. There’re plenty of other projects out there which are showing where we can go with the design of the framework and this is just the beginning!

For further information you can take a look at my ng-conf talk “Mad Science with the Angular Compiler” (you can directly skip to 7 min to see the actual tools):

Or if you prefer to dig into the existing tools taking advantage of static analysis: