Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

dyfactor-plugin-disambiguate-locals

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dyfactor-plugin-disambiguate-locals

Dyfactor codemod for migrating to mandatory "this" in glimmer templates

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Disambiguate Locals

Build Status

This is a Dynamic Dyfcator Plugin that identifies local properties that are typically resolved by Ember's property fallback functionality. This is meant to provide a migration path for RFC#308.

Usage

> yarn add dyfactor-plugin-disambiguate-locals --dev

> dyfactor run template disambiguate-locals ./app --level <extract|modify>

What Does This Do?

Given a template and component that look this:

import Component from '@ember/component';

export Component.extend({
  name: 'Chad',
  company: 'LinkedIn'
});
<h1>{{name}}!</h1>
<h2>Company: {{company}}</h2>

<ul>
  {{#each projects as |project|}}
    <li>{{project.name}}</li>
  {{/each}}
</ul>

This plugin will either re-write the template to:

-  <h1>{{name}}!</h1>
+  <h1>{{this.name}}!</h1>
-  <h2>Company: {{company}}</h2>
+  <h2>Company: {{this.company}}</h2>

   <ul>
     {{#each projects as |project|}}
       <li>{{project.name}}</li>
     {{/each}}
   </ul>

or write a telemetry file to disk that looks like the following:

{
  "./app/templates/components/top-card.hbs": ["name", "company"]
}

FAQs

Package last updated on 20 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts