Git Product home page Git Product logo

Comments (4)

lifesinger avatar lifesinger commented on August 15, 2024

这个没问题的,在 arale.core 的文件里,将相关全局变量 $E, $, $$ 等等暴露到 window 上就好。

from aralejs.github.io.

shaoshuai0102 avatar shaoshuai0102 commented on August 15, 2024

我说另外一个思路:

  1. 不管现有的代码,arale 2.0的代码完全遵守规范,用新的组织方式,API保持不变,全局变量全部干掉。
  2. 页面中加载seaJS,可使用全新的arale

优点:

  1. 因为seaJS的特性,新的代码不会与老代码有命名空间的冲突
  2. 可以促进老代码向新代码的更新
  3. 我们的开发会更容易

缺点:

  1. 页面中加载的代码太多
  2. 产品线改动页面功能的时候会比较纠结

just一个思路。。。

from aralejs.github.io.

leoner avatar leoner commented on August 15, 2024

目前主要也是分两条路在走.

  • 我现在做的测试主要目的就是为了和现有的情况兼容, 尽量保证现有的代码改动性小. 今天core这部分在测试下如果没有问题的话, 其实就可以把目前的arale.core-1.1替换成我们模块化好的代码, 目前的情况应该可以达到所有产品既可以通过require的方式来快速把模块的内容引入进来, 也可以按照原有的方式机继续开发. 现在我们最主要还是尽快的先把arale.2.0最基本的运行环境先跑起来. 后续工作就好做些了.
  • 我们现在也可以开始构建我们未来真正的2.0运行环境了, 在新的环境下我们如何构建模块, 然后新的模块的粒度如何, 怎么进行资源整合(比如和light有功能类似的地方, 还有无线相关的一些基础类库.) 代码如何组织(是否沿用maven的目录结构形式) 都可以进行讨论了.

from aralejs.github.io.

leoner avatar leoner commented on August 15, 2024

目前通过每一个模块中动态生成seajs.use('artifactId-version.js')语句, 然后用户直接引用arale.core文件的时候就会首先加载这些模块, 然后每个模块加载完成后会自动执行seajs.use,这样就会执行模块的factory. 这样当arale.core加载完毕后, 当前页面是直接就可以访问arale.core中的全局变量了.

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.