Git Product home page Git Product logo

Comments (5)

nwind avatar nwind commented on August 25, 2024

5m 算正常吧,目前代码几十万行了

from amis.

ranwawa avatar ranwawa commented on August 25, 2024

5m 算正常吧,目前代码几十万行了

从功能和代码行数上来说确实正常。

但从用户角度来说有点儿大了,一个网页,首次加载几秒十几秒时间

一个依赖amis项目,可能只会用到其中小部分组件,但却需要加载所有组件的依赖,特别是那些用不着的超大依赖,比如excel,代码编辑器等等

随着功能不断的继续叠加,后面会不会超过10M呢,首次加载速度会不会更慢呢?

以下解决方案纯属yy,没有切实可行的技术方案

    1. 所有插件由业务方自己动态注册?
    1. amis官方只注册基础的插件,其他插件由业务方主动注册?
    1. 或者干脆像fortawesome一样,实现一套插件发现机制,用不着的插件都不注册

from amis.

citynook avatar citynook commented on August 25, 2024

我的用法是:

  1. 开发平台引用 amis, amis-edit 依赖,用编译器生成 json 并保存到数据库中
  2. 业务平台引用 sdk,并用在 index.html 中就引入 sdk.js 及相关的文件,其它页面从数据库中读取 json 并调用 sdk 进行渲染。
    就算慢也是加载首页慢,其它的页面都满快的。

from amis.

978744151 avatar 978744151 commented on August 25, 2024

我的用法是:

  1. 开发平台引用 amis, amis-edit 依赖,用编译器生成 json 并保存到数据库中
  2. 业务平台引用 sdk,并用在 index.html 中就引入 sdk.js 及相关的文件,其它页面从数据库中读取 json 并调用 sdk 进行渲染。
    就算慢也是加载首页慢,其它的页面都满快的。

这是个可行性方案,sdk.js的cdn文件你是从哪找到的,我看官网没有啊

from amis.

citynook avatar citynook commented on August 25, 2024

官网下载页面可以下载 sdk
image
我的项目是解压放在 /resource/js/amis-sdk 目录下

index.html引用

    <link rel="stylesheet" href="/node_modules/amis/lib/themes/cxd.css" />
    <!-- Amis SDK helper 样式放在末尾提高优先级 -->
    <link rel="stylesheet" href="/resource/js/amis-sdk/helper.css" />
    <link rel="stylesheet" href="/resource/js/amis-sdk/iconfont.css" />
    <link rel="stylesheet" href="/node_modules/amis-editor-core/lib/style.css" />
    <script src="/resource/js/amis-sdk/sdk.js"></script>

然后页面里用 sdk 提供的方法渲染即可

from amis.

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.