Git Product home page Git Product logo

Comments (3)

popomore avatar popomore commented on August 15, 2024

oo选型

oo选择类似mootools的风格,oo为独立模块arale.class

  • 接口名:Class.create(prop)
  • prop:Extends 继承 Object
  • prop:Implements 混入 Object/Array
  • prop:initialize 构造函数 Function
  • 返回:Function
    • 方法:superclass 父类的引用 Object
    • 方法:implement 混入 Object/Array
  • 规范化初始化参数的方式

例子:

 var Class = require('class')
 var klass = Class.create({
      Extends: a,
      Implements: [b, c],
      initialize: function(args){
           this.attrs = $.extend({},klass.defaults, args);
           this.superclass.initialize();
      },
      method: function(){}
 });

 klass.implement([d, e]);

 klass.defaults = {
      param1 : 1
 }; 

Infrastructure选型

组件的基础设施,主要提供组件的核心功能,混入使用。一期只提供两种。

EventTarget

事件机制

widget

提供组件整个生命周期,康辉提供

util&widget

功能组件和ui组件,这部分下面会提供组件列表,康辉提供

开发规范

组件模版

选择一种模版引擎作为组件的模版。

常用词的统一命名

函数参数的约定,比如传入的参数不能多于5个

以上由玉伯提供

组件样式

组件的样式需跟随组件,考虑开发和发布的场景

样式为可选,组件可以不使用默认样式,使用自己的样式

gjslint

所有的代码必须通过gjslint,不使用strict

目录规范

玉伯提供项目整体和每个组件的目录规范,包括以下内容

  • api文档,一期不生成文档,但注释要按jsdoc的规范
  • 源码
  • 测试用例
  • demo
  • readme&changelog
  • pom.xml

单元测试

使用jasmine

api风格

写代码要精神上统一

  • 如无必要,勿增实体
  • 一目了然,容易学习
  • 支持DATA-ATTRIBUTE API

现有文档整理

总结现有规范的文档,放在github的wiki上

  • 代码规范(通过gjslint) -- 南伯
  • 代码风格规范 -- 贯高
  • 常用词的统一命名 -- 玉伯
  • 注释规范(按jsdoc) -- 余化
  • readme规范和demo规范 -- 偏右

from aralejs.github.io.

lifesinger avatar lifesinger commented on August 15, 2024

已整理到:

https://github.com/alipay/arale/wiki/%E4%B8%80%E6%9C%9F%E5%88%86%E5%B7%A5%E4%B8%8E%E8%BF%9B%E5%BA%A6%E8%A1%A8

from aralejs.github.io.

popomore avatar popomore commented on August 15, 2024

辛苦玉伯了

from aralejs.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.