当前位置: 首页 > 软件库 > 程序开发 > >

ember-native-class-codemod

授权协议 Readme
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 卫念
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

ember-native-class-codemod

A codemod for transforming your ember app code to native JavaScript class syntaxwith decorators!

Usage

First, install the dependencies that the codemod relies on. These areaddons that the codemod will add imports from:

ember install ember-classic-decorator
ember install ember-decorators 

Then, boot up your application. Then, the codemod can be run using thefollowing command:

npx ember-native-class-codemod http://localhost:4200/path/to/server [OPTIONS] path/of/files/ or/some**/*glob.js

The codemod accepts the following options:

Option Value Default Details
--class-fields boolean true Enable/disable transformation using class fields
--decorators boolean true Enable/disable transformation using decorators
--classic-decorator boolean true Enable/disable adding the @classic decorator, which helps with transitioning Ember Octane
--type String Empty (match all types in path) Apply transformation to only passed type. The type can be one of services, routes, components, controllers
--quote String 'single' Whether to use double or single quotes by default for new statements that are added during the codemod.

Gathering Runtime Data

The first argument that you must pass to the codemod is the URL of a runninginstance of your application. The codemod opens up your application and analyzesthe classes directly, so it can transform them, which is why it needs this URL.Any classes that were not analyzed will not be transformed. This includesclasses that are private to a module and never exported.

If you have any lazily loaded modules, such as modules from Ember Engines,you'll need to make sure that the URL you provide loads these modules as well.Otherwise, the codemod will not be able to detect them or analyze them.

Types

The type option can be used to further narrow down transforms to a particular type ofember object within the application or addon. The types can be any of thefollowing:

Type Option
Services --type=services
Routes --type=routes
Components --type=components
Controllers --type=controllers

The path of the file being transformed is matched against the glob pattern ofthe type to determine whether to run the specific transforms.

If a type is not provided, the codemods will run against all the types inthe path provided.

Debugging

The codemods log execution information in the codemods.log file in the currentdirectory where the codemods are being executed. Specifically, details such asfailures and reasons for failures, are logged. This would be the recommendedstarting point for debugging issues related to these codemods.

Unsupported Types

While the codemods transforms many types of ember objects, it does not supporttransformation of

  • ember-data classes such as DS.Model, DS.Adapter etc
  • Mixins
  • Ember Objects with objects or arrays as direct properties (actions andqueryParams are the exception). See eslint-plugin-ember/avoid-leaking-state-in-ember-objectsfor more details.
  • Ember objects with computed properties that use the meta or propertymodifiers.

More Transform Examples

Contributing

Installation

  • clone the repo
  • change into the repo directory
  • yarn

Running Tests

  • yarn test

Update Documentation

  • yarn update-docs
  • ReactNativeAppDemo ReactNativeAppDemo 是一个以react-native+mobx为基础搭建的app案例,旨在让初学者了解基本的RNApp的搭建与应用。 教程包含基础框架搭建、路由封装、导航栏封装、service封装、全局报错处理封装、高阶组件封装、全局事件消息总线封装... 查看github地址 支持平台 IOS Android 效果图 基础环境搭建 按照re

  • 版本 0.56  启用babel package.json "devDependencies": { "@babel/core": "7.0.0-beta.47", "@babel/plugin-proposal-decorators": "7.0.0-beta.47", "babel-jest": "23.6.0", "babel-preset-react-native": "^

  • native有天生的,本土的,也就是说生来就有的, 那也就是说自动生成,不需要人工来帮忙或者管控的. 而assigned是指指定的,分配的, 如果你不赋予他甚麼东西,那麼他是不能实现的. 需要人工,自己把某个东西赋予给它 所以是assigned 在用Hibernate的时候,当有表中的主键是库自动生成的时候将使用native。 而当是自己添加的时候则需要改为assigned。 否则将会出现异常!

  • 设置主键 HIbernate主键详解——Native Native主键生成方式会根据不同的底层数据库自动选择Identity、Sequence、Hilo主键生成方式 特点:根据不同的底层数据库采用不同的主键生成方式。由于Hibernate会根据底层数据库采用不同的映射方式,因此便于程序移植,项目中如果用到多个数据库时,可以使用这种方式

  • Java native代码编译步骤简书 目的:防止java代码反编译获取密码算法 (1)编写实现类 com.godlet.PasswordAuth.java (2)编译java代码 javac PasswordAuth.java //中文乱码问题 javac -encoding utf-8 PasswordAuth.java (3)切换到代码home目录 cd ..\..\ (4)生成Native

  • 今天学Java遇到一个名词:原生代码 引导类加载器(bootstrap class loader):它用来加载 Java 的核心库,是用原生代码来实现的 扩展类加载器(extensions class loader):它用来加载 Java 的扩展库。 系统类加载器(system class loader):它根据 Java 应用的类路径(CLASSPATH)来加载 Java 类 tomcat为每个

  • 一  共同点       都可对类进行加载,返回Class对象(不是实例对象,Class对象是将.class文件加载到内存中,实例对象就是通常我们所说的new Object()) 二   区别        Class 中有两个重要方法: forName(String className) : 返回与带有给定字符串名的类或接口相关联的 Class 对象。 forName(String name,

 相关资料
  • ember-class-based-modifier ⚠️ �� This addon has been deprecated in favor of the official ember-modifier addon. See the upgrade guide. This is the next iteration of ember-oo-modifiers with some breakin

  • IMPORTANT: You probably don't need this addon. In Ember, since ember-(cli-)qunit 3.X (around late 2017) there is a new testing API that alreadyprovides almost identical test helpers from the ones in t

  • Ember检查器是一个浏览器插件,用于调试Ember应用程序。 灰烬检查员包括以下主题 - S.No. 灰烬检查员方式和描述 1 安装Inspector 您可以安装Ember检查器来调试您的应用程序。 2 Object Inspector Ember检查器允许与Ember对象进行交互。 3 The View Tree 视图树提供应用程序的当前状态。 4 检查路由,数据选项卡和库信息 您可以看到检查

  • 跨文件筛选器列表提供条件和逻辑。 如果列表中的所有过滤器都返回true,则返回true。 否则,它返回false。 Class 声明 (Class Declaration) 以下是org.apache.commons.io.filefilter.AndFileFilter类的声明 - public class AndFileFilter extends AbstractFileFilter

  • 枚举IO区分大小写。 不同的操作系统对文件名的区分大小写有不同的规则。 例如,Windows对文件命名不区分大小写,而Unix区分大小写。 IOCase捕获该差异,提供枚举以控制应如何执行文件名比较。 它还提供了使用枚举来执行比较的方法。 Enum宣言 以下是org.apache.commons.io.IOCase Enum的声明 - public enum IOCase extends E

  • 提供用于读取,写入和复制文件的实用方法。 这些方法适用于InputStream,OutputStream,Reader和Writer。 Class 声明 (Class Declaration) 以下是org.apache.commons.io.IOUtils类的声明 - public class IOUtils extends Object 特点 (Features) 为输入/输出操作提供