🚀 The Progressive App Framework Based On React

Overview

English | 简体中文

icejs

Downloads Version GitHub license PRs Welcome Gitter

A universal framework based on React.js, Docs.

Features

  • 🐒 Engineering:Out of the box support for ES6+、TypeScript、Less、Sass、 CSS Modules,etc
  • 🦊 Routing:Powerful Routing System, supports configured routing and conventions routing
  • 🐯 State management:Built-in icestore, lightweight state management solution based on React Hooks
  • 🐦 Config:Modes and Environment Variables configuration in the config file
  • 🐶 Logger:Built-in logger solution, it's a flexible abstraction over using console.log as well
  • 🦁 Application configuration:Provide powerful and extensible application configuration
  • 🐴 Hooks:Provide Hooks APIs such as useModel and useHistory, etc
  • 🐌 Plugin system:The plugin system provides rich features and allow the community to build reusable solutions
  • 🐘 TypeScript:Support TypeScript
  • 🐂 Modern:Support SPA, SSR, MPA and Micro-frontend

Quick start

Setup by VS Code

We recommend creating a new icejs app using AppWorks:

demo

See Quick start by AppWorks for more details.

Setup by CLI

We recommend creating a new icejs app using create-ice, which sets up everything automatically for you. To create a project, run:

$ npm init ice <project-name>

npm init is available in npm 6+

Start local server to launch project:

$ cd <project-name>
$ npm install
$ npm run start # running on http://localhost:3333.

It's as simple as that!

Examples

Contributing

Please see our CONTRIBUTING.md

Contributors

chenbin92/
chenbin92
ClarkXia/
ClarkXia
狒狒神/
狒狒神
Hengchang
Hengchang Lu
大果/
大果
那吒/
那吒
NK/
NK
yangfan/
yangfan
Rhuzerv/
Rhuzerv
f00bar/
f00bar
许文涛/
许文涛
炽翎/
炽翎
sspku-yqLiu/
sspku-yqLiu
Jesse
Jesse Feng
MO/
MO
chenliandong/
chenliandong
sprying/
sprying
0xflotus/
0xflotus
AshShen/
AshShen
Atef
Atef Ben Ali
Eric
Eric Zhang
Far
Far Tseng
QYW/
QYW
Art.XD/
Art.XD
Yurisa/
Yurisa
ZHOU
ZHOU Cheng
游鹿/
游鹿
nancy/
nancy
nieyao/
nieyao
truman.p.du/
truman.p.du
dadalong/
dadalong
yanchanglu/
yanchanglu
zhyupe/
zhyupe
二凢/
二凢
木杉/
木杉
蒋启钲/
蒋启钲
赵的拇指/
赵的拇指
赵锐/
赵锐

Ecosystem

Project Version Docs Description
icejs icejs-status docs A universal framework based on react.js
icestark icestark-status docs Micro Frontends solution for large application
icestore icestore-status docs Simple and friendly state for React
formily formily-status docs Performant, flexible and extensible form solution
ahooks ahooks-status docs React Hooks Library

Community

DingTalk community GitHub issues Gitter
issues gitter

License

MIT

Comments
  • Vite 模式如何使用 unocss

    Vite 模式如何使用 unocss

    What is the current behavior? 发生了什么?

    What is the expected behavior? 期望的结果是什么?

    Any additional comments? 相关环境信息?

    • ice.js Version
    • build.json Configuration
    • Node Version:
    • Platform:
    opened by chenar-x 24
  • icestark IE11下子应用始终加载失败

    icestark IE11下子应用始终加载失败

    1.Chrome下应用能正常访问 2.IE11下,框架和子应用分别独立访问可正常访问 3.IE11下框架应用始终命中ErrorComponent,提示子应用加载失败,F12查看控制台无任何报错 4.框架appConfig配置如下:

    icestark: { type: 'framework', Layout: FrameworkLayout, getApps: async () => { }, appRouter: { basename: '/', ErrorComponent: <div style={{ fontSize: "18px" }}>应用有更新,请<a style={{ color: "#1375d8", cursor: "pointer", }} onClick={() => { window.location.reload(); }}>刷新应用</a></div>, LoadingComponent: <div>&nbsp;</div>, }, },

    发生了什么?

    复现步骤,错误日志以及相关配置

    建议并上传到你的 GitHub 仓库,请使用 yarn init ice <project-name> 选择 Lite 模板,这样您的问题我们会更高优先级的进行解决。

    期望的结果是什么

    IE11下能正常访问应用

    相关环境信息

    • ice.js 版本
    • build.json 配置
    • Node 版本
    • 操作系统
    bug icestark 
    opened by rootsli 24
  • npm run build error

    npm run build error

    What is the current behavior? 发生了什么?

    无法编译版本,

    $ npm run build
    
    > [email protected] build E:\试验场\node-demo\Test
    > icejs build
    
    ice.js 1.18.1
    (node:17616) ExperimentalWarning: The fs.promises API is experimental
    info 使用 Fusion 组件主题包: @alifd/theme-design-pro
                                             10% building(node:17616) [DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hooks.processAssets instead and use one of Compilation.PROCESS_ASSETS_STAGE_* as stage option)
    (node:17616) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
                                             92% sealing
    <--- Last few GCs --->
    
    [17616:0000016D5837D920]    44194 ms: Mark-sweep 1027.7 (1209.9) -> 1027.7 (1159.4) MB, 166.1 / 0.0 ms  (average mu = 0.682, current mu = 0.000) last resort GC in old space requested      
    [17616:0000016D5837D920]    44359 ms: Mark-sweep 1027.7 (1159.4) -> 1027.7 (1145.4) MB, 165.1 / 0.0 ms  (average mu = 0.505, current mu = 0.000) last resort GC in old space requested      
    
    
    <--- JS stacktrace --->
    
    ==== JS stack trace =========================================
    
        0: ExitFrame [pc: 000001D7360DC5C1]
        1: StubFrame [pc: 000001D7360CBAB6]
    Security context: 0x03755771e6e1 <JSObject>
        2: replace [00000375577105E1](this=0x034a81e036a1 <Very long string[284090880]>,0x03e33eaf1c99 <JSRegExp <String[18]: [<>\/\u2028\u2029]>>,0x03e33eaf1d31 <JSFunction escapeUnsafeChars 
    (sfi = 0000031CA2635991)>)
        3: serialize(aka serialize) [0000031CA2637C11] [E:\???\node-demo\Test\node_modules\serialize-javasc...
    
    FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
     1: 00007FF6F1340EFA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810
     2: 00007FF6F131A296 node::MakeCallback+4518
     3: 00007FF6F131AC80 node_module_register+2160
     4: 00007FF6F15B09BE v8::internal::FatalProcessOutOfMemory+846
     5: 00007FF6F15B08EF v8::internal::FatalProcessOutOfMemory+639
     6: 00007FF6F1AEE954 v8::internal::Heap::MaxHeapGrowingFactor+11476
     7: 00007FF6F1AEC6E8 v8::internal::Heap::MaxHeapGrowingFactor+2664
     8: 00007FF6F168F0CB v8::internal::Factory::AllocateRawWithImmortalMap+59
     9: 00007FF6F1691BCD v8::internal::Factory::NewRawTwoByteString+77
    10: 00007FF6F18A5C58 v8::internal::Smi::SmiPrint+536
    11: 00007FF6F15A3ECB v8::internal::StringHasher::UpdateIndex+219
    12: 00007FF6F174CC4B v8::internal::wasm::WasmInterpreter::Thread::Step+38283
    13: 000001D7360DC5C1
    npm ERR! code ELIFECYCLE
    npm ERR! errno 134
    npm ERR! [email protected] build: `icejs build`
    npm ERR! Exit status 134
    npm ERR!
    npm ERR! Failed at the [email protected] build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     F:\node-cache\node\_logs\2021-06-30T02_36_18_138Z-debug.log
    

    What is the expected behavior? 期望的结果是什么?

    Any additional comments? 相关环境信息?

    • ice.js Version
    • build.json Configuration
    • Node Version:
    • Platform:

    使用APPWORKS创建【JS】Fusion Design Pro即可复现

    need repro 
    opened by TrumanDu 23
  • [iceworks]RFC: Adapter 开发规范讨论

    [iceworks]RFC: Adapter 开发规范讨论

    名词解释

    Adapter, iceworks 为了适配不同工程工具以及不同项目结构而抽象出的概念,Adapter 核心会实现两部分能力:

    1. 工程工具:即使用的构建调试工具,比如 ice-scripts/vue-cli,决定了项目启动构建以及工程配置等能力
    2. Kit: 即项目开发的最佳实践,包含目录结构、路由配置、权限管理等,决定了面板里新建页面、新建路由如何实现,目前有两个版本 [email protected](routeConfig/menuConfig)[email protected](配置信息收敛到 config/)

    项目约定

    通过对项目指定对应的 adapter 即可接入 iceworks 进行开发,配置如下:

    // 用户项目的 package.json
    {
      "iceworks": {
        "adapter": "ice-adapter",   
      }
    }
    

    adapter 加载

    加载时机

    当用户在 iceworks 「切换项目」、「导入项目」、「新建项目』时,需要根据项目的 package.json 中指定的 adapter 进行动态安装并进行加载。

    • adapter 在 iceworks 运行环境中执行,因此会作为 iceworks 的依赖进行安装。
    • adapter 的版本策略
    • adapter 检查更新机制
    • 检查当前 adapter 是否已经安装

    加载逻辑

    当检测到项目变化时需要发送请求到后端,并检查当前 adapter 是否已经安装过:

    • 如果已经安装过的 adapter 则会写入到 用户系统 .iceworks 的配文件中进行缓存,以此保证不必要的安装流程。
    • 如果检查当前 adapter 没有安装,则需要动态执行安装 adapter 的操作,当安装完成时,并重新执行 loadAdapter 方法进行初始化。在安装过程中前端 UI 需要给出对应的提示,告知用户「由于当前项目依赖的 Adapter 发生改变,正在重新加载」 之类的提示。

    加载逻辑

    面板开发

    • 面板 UI 配置

    面板 UI 配置指的是在 iceworks 中 「项目管理」和「工程管理」的面板展示形式可被修改,被定制成根据 Adapter 的实现进行展示的一种机制。其核心实现是面板 UI 部分会提供对应的属性,通过在 Adapter 中配置属性进行面板的配置化展示。

    • 隐藏面板

    隐藏面板指的是在 iceworks 中「项目管理」和「工程管理」的面板展示可被隐藏,可以根据实际工程的最佳实践只展示某些需要的面板。其核心实现是 Adapter 开发中只实现需要展示的面板接口即可,未实现的接口则不会进行展示。

    • 新增面板(暂不实现)

    新增面板指的是在 iceworks 中「项目管理」和「工程管理」的面板展示上新增加一个面板,或者当面板 UI 定制提供的属性不能满足定制需求时,需要进行面板开发。

    具体实现

    Adapter 目录规范

    adapter
    ├─ modules/         ---- 模块实现
    │  ├─ menu/
    │  ├─ router/ 
    │  ├─ task/ 
    │  └─ index.ts
    |
    ├─ locales/         ---- 多语言配置
    │  ├─ en-US.json
    │  └─ zh-CN.json
    |
    ├─ package.json
    └─ README.md
    

    Adapter 开发

    • 如果你需要实现的 Adapter 功能与 ICE 团队提供的 Adapter 功能大致相似,但是你希望定制面板 UI 或者想隐藏一些面板时,我们希望你基于 ice adapter 进行开发。

    面板逻辑实现

    // adapter/modules/menu.ts
    // Menu 实现
    import * as iceAdapter from '../ice-adapter';
    
    class MenuAdapter extends iceAdapter.Menu {
      getAll() {
    
      }
    }
    

    面板 UI 配置

    // config.ts
    const config = {
     menu: {
        title: '菜单管理',
        description: '展示项目中的所有菜单,支持对菜单的增删改。',
        cover: 'https://img.alicdn.com/tfs/TB1mZ.Xc8GE3KVjSZFhXXckaFXa-300-300.png',
        isAvailable: true,
    
        // 新增 props 字段,用于控制前端 UI 面板的展示
        props: {
          icon: 'home',
        } 
      },
    }
    

    Adapter 面板导出

    // index.ts
    import Menu from './menu';
    
    export {
      menu: {
          title: '',
          description: '',
          cover: ''
          module: Menu,
          isAvailable: true
      },
      ...
    };
    
    
    • 如果你需要实现的 Adapter 功能与 ICE 团队提供的 Adapter 功能差异较大,你可以根据 接口定义 单独实现 Adapter 功能,以及新增面板功能等。

    注释:暂不支持

    关于 Adapter 命名规范

    命名规范遵循 「简单」、「语义化」、「易理解」原则,Adapter 命名规范如下:

    # 命名规范
    => adapter-<工程工具名称>-<工程工具版本>-<最佳实践模板名称>-<最佳实践模板版本>
    
    # 命名示例
    => adapter-ice-scripts-2-kit-2
    => adapter-ice-scripts-2-kit-3
    

    TODO

    • [x] 动态加载的能力 @chenbin92
    • [x] 目录改造 @chenbin92
    • [ ] props 定制面板能力 @temper357
    • [ ] [email protected] + kit@2x => adapter-ice-scripts-1-kit-2 @temper357
    • [ ] [email protected] + kit@2x => adapter-ice-scripts-2-kit-2 @temper357
    • [ ] [email protected] + kit@3x => adapter-ice-scripts-2-kit-3 @chenbin92
    • [ ] [email protected] + kit@2x => adapter-vue-cli-3-kit-2 @Orange-C
    • [ ] 老项目迁移到 3.x 给出引导提示 @chenbin92

    其他

    • 涉及到目录改动,对现有 iceworks-3.x 的变更可能会有冲突
    opened by chenbin92 23
  • [项目] 导航菜单 & 路由管理功能

    [项目] 导航菜单 & 路由管理功能

    背景

    原先方案存在的问题:

    • 路由与 Layout 耦合,维护起来不方便
    • 路由扁平,不支持任何级别的嵌套

    路由方案

    最终方案如下:

    src/config/routes.js 文件内容

    import React from 'react';
    
    import UserLayout from './layouts/UserLayout';
    import BasicLayout from './layouts/BasicLayout';
    
    const UserLogin = React.lazy(() => import('./pages/UserLogin'));
    const UserRegister = React.lazy(() => import('./pages/UserRegister'));
    const Dashboard = React.lazy(() => import('./pages/Dashboard'));
    const Charts = React.lazy(() => import('./pages/Charts'));
    const BasicCharts = React.lazy(() => import('./pages/BasicCharts'));
    const Terms = React.lazy(() => import('./pages/Terms'));
    const Result = React.lazy(() => import('./pages/Result'));
    const BasicList = React.lazy(() => import('./pages/BasicList'));
    const ProjectList = React.lazy(() => import('./pages/ProjectList'));
    const BasicTable = React.lazy(() => import('./pages/BasicTable'));
    const GeneralTable = React.lazy(() => import('./pages/GeneralTable'));
    const Profile = React.lazy(() => import('./pages/Profile'));
    const Setting = React.lazy(() => import('./pages/Setting'));
    const Fail = React.lazy(() => import('./pages/Fail'));
    const Empty = React.lazy(() => import('./pages/Empty'));
    const Forbidden = React.lazy(() => import('./pages/Forbidden'));
    const NotFound = React.lazy(() => import('./pages/NotFound'));
    const ServerError = React.lazy(() => import('./pages/ServerError'));
    
    const routerConfig = [
      {
        path: '/user',
        component: UserLayout,
        children: [
          {
            path: '/login',
            component: UserLogin,
          },
          {
            path: '/register',
            component: UserRegister,
          },
          {
            path: '/',
            redirect: '/user/login',
          },
          {
            component: NotFound,
          },
        ],
      },
      {
        path: '/',
        component: BasicLayout,
        children: [
          {
            path: '/dashboard/monitor',
            component: Dashboard,
          },
          {
            path: '/chart/general',
            component: Charts,
          },
          {
            path: '/chart/basic',
            component: BasicCharts,
          },
          {
            path: '/list/basic',
            component: BasicList,
          },
          {
            path: '/list/general',
            component: ProjectList,
          },
          {
            path: '/result/success',
            component: Result,
          },
          {
            path: '/result/fail',
            component: Fail,
          },
          {
            path: '/table/basic',
            component: BasicTable,
          },
          {
            path: '/profile/basic',
            component: Profile,
          },
          {
            path: '/profile/general',
            component: Terms,
          },
          {
            path: '/table/general',
            component: GeneralTable,
          },
          {
            path: '/account/setting',
            component: Setting,
          },
          {
            path: '/exception/500',
            component: ServerError,
          },
          {
            path: '/exception/403',
            component: Forbidden,
          },
          {
            path: '/exception/204',
            component: Empty,
          },
          {
            path: '/exception/404',
            component: NotFound,
          },
          {
            // Redirect 重定向
            path: '/',
            redirect: '/dashboard/monitor',
          },
          {
            // 404 没有匹配到的路由
            component: NotFound,
          },
        ],
      },
    ];
    
    export default routerConfig;
    

    src/router.jsx

    import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom';
    import React, { Suspense } from 'react';
    import path from 'path';
    import routes from '@/routerConfig';
    import PageLoading from '@/components/PageLoading';
    
    const RouteItem = (props) => {
      const { redirect, path: routePath, component, key } = props;
      if (redirect) {
        return (
          <Redirect
            exact
            key={key}
            from={routePath}
            to={redirect}
          />
        );
      }
      return (
        <Route
          key={key}
          component={component}
          path={routePath}
        />
      );
    };
    
    const router = () => {
      return (
        <Router>
          <Switch>
            {routes.map((route, id) => {
              const { component: RouteComponent, children, ...others } = route;
              return (
                <Route
                  key={id}
                  {...others}
                  component={(props) => {
                    return (
                      children ? (
                        <RouteComponent key={id} {...props}>
                          <Suspense fallback={<PageLoading />}>
                            <Switch>
                              {children.map((routeChild, idx) => {
                                const { redirect, path: childPath, component } = routeChild;
                                return RouteItem({
                                  key: `${id}-${idx}`,
                                  redirect,
                                  path: childPath && path.join(route.path, childPath),
                                  component,
                                });
                              })}
                            </Switch>
                          </Suspense>
                        </RouteComponent>
                      ) : (
                        <Suspense fallback={<PageLoading />}>
                          {
                            RouteItem({
                              key: id,
                              ...props,
                            })
                          }
                        </Suspense>
                      )
                    );
                  }}
                />
              );
            })}
          </Switch>
        </Router>
      );
    };
    
    export default router;
    

    可视化管理路由

    功能

    • [x] 导航面板
      • [x] 树级拖拽
      • [x] 增删改导航、导航组和外链
    • [x] adapter
      • [x] 生成 menuConfig

    路由管理

    菜单管理

    opened by chenbin92 23
  • Iceworks/state hooks

    Iceworks/state hooks

    如何使用

    声明 Model

    // src/models/materials.js
    export default {
      namespace: 'materials',
      state: {
        dataSource: [],
      },
      reducers: {
        async refresh() {
          const dataSourde = await fetch(/* api */);
          return { dataSourde };
        },
      },
    };
    

    创建 Store 并注册 Model

    // src/store.js
    import materials from '@models/materials';
    import Store from '@store';
    
    const store = new Store();
    store.registerModel(materials);
    
    export default store;
    

    在 View 中使用 Model

    // src/pages/Materials/index.js
    import React, { useEffect } from 'react';
    import store from '@src/store';
    
    const Material = () => {
      const [materials] = store.useModel('materials');
      const { state: { dataSource } } = materials;
    
      useEffect(() => {
        (async () => {
          await materials.refresh();
        })();
      }, []);
    
      return (
        <div>
          <h2>Material</h2>
          <div>
            {dataSource.map(({ name }) => name)}
          </div>
        </div>
      );
    };
    
    export default Material;
    

    增删改

    // src/models/projects.js
    export default {
      namespace: 'projects',
      state: {
        dataSource: [],
      },
      reducers: {
        async refresh() {
          return { dataSource: await fetch(/* api */) };
        },
        async add(project) {
          return { dataSource: await fetch(/* api */, project) };
        },
        async remove(id) {
          return { dataSource: await fetch(/* api */, id) };
        },
        async setProject(data) {
          return { dataSource: await fetch(/* api */, data) };
        },
      },
    };
    
    // src/pages/Project/index.js
    import React, { useEffect } from 'react';
    import { Input, Button } from '@alifd/next';
    import store from '@src/store';
    
    const Project = () => {
      const [projects] = store.useModel('projects');
    
      const { state: { dataSource } } = projects;
    
      useEffect(() => {
        (async () => {
          await projects.refresh();
        })();
      }, []);
    
      return (
        <div>
          <div>
            <div>my projects</div>
            <ul>
              {dataSource.map(({ name, id }, index) => {
                return (
                  <li key={index}>
                    {name}
                    <Button onClick={async () => { await projects.remove(id); }}>
                      删除
                    </Button>
                  </li>
                );
              })}
            </ul>
          </div>
          <div>
            <Input
              type="text"
              onPressEnter={async (event) => { await projects.add({ name: event.target.value }); }}
            />
          </div>
        </div>
      );
    };
    
    export default Project;
    
    opened by alvinhui 23
  • 官方物料源加载失败

    官方物料源加载失败

    环境信息

    Window 7 node 10.15

    • 操作系统:
    • Iceworks 版本: 2.15

    问题描述

    image

    打开飞冰主界面什么都不显示,感觉是连不上网路,是不是因为上网需要有代理的缘故, 导致的,

    打开开发工具 image 事实上我直接访问网址是可以 ,连接的

    node 代理也设置过

    错误信息

    opened by alextiffy 23
  • RFC: 前端异步操作状态的同步到视图

    RFC: 前端异步操作状态的同步到视图

    目标

    前端在发出异步请求前后能同步状态到视图中。

    背景

    当前使用 icestore 进行异步数据请求,但没有在数据请求发起后:

    • 显示等待效果
    • 数据请求失败后显示错误信息。

    示例

    以请求依赖列表为例,下面的代码没有上面所描述的两种处理:

    store:

    export default {
      dataSource: [],
    
      async refresh() {
        this.dataSource = await (await fetch(/* api */)).json();
      },
    
      async install(data) {
        await fetch(/* api */, data);
      },
    };
    

    view:

    import stores from '@src/stores';
    
    const Component = () => {
      const dependenciesStore = stores.useStores('dependencies'); 
    
      useEffect(() => {
        dependenciesStore.refresh();
      }, []);
    
      function onInstall() {
        async function install() {
          await dependenciesStore.install();
    
          dependenciesStore.refresh();
        }
    
        install();
      }
    
      return 
        <div>
          <button onClick={onInstall}>
            安装新依赖
          </button>
          <div>
            {dependenciesStore.dataSource.map(({name, id}) => {
              return <div>
                {name}
              </div>;
            })}
          </div>
        </div>;
    };
    

    基于 icestore 业务层如果要处理

    store:

    export default {
      dataSource: [],
    
      refreshError: undefined,
    
      refreshLoading: false,
    
      installError: undefined,
    
      installLoading: false,
    
      setRefreshLoading(value) {
        this.refreshLoading = value;
      }
    
      setInstallLoading(value) {
        this.installLoading = value;
      }
    
      async refresh() {
        try {
          this.dataSource = await (await fetch(/* api */)).json();
          this.refreshError = '';
        } catch (error) {
          this.refreshError = error;
        }
      },
    
      async install(data) {
        try {
          await fetch(/* api */, data);
          this.installError = '';
        } catch (error) {
          this.installError = error;
        }
      }
    };
    

    view:

    import stores from '@src/stores';
    
    const Component = () => {
      const dependenciesStore = stores.useStores('dependencies'); 
    
      async function fetch() {
        await dependenciesStore.setRefreshLoading(true);
        await dependenciesStore.refresh();
        await dependenciesStore.setRefreshLoading(false);
      }
      useEffect(() => {
        fetch();
      }, []);
    
      function onInstall() {
        async function install() {
          await dependenciesStore.setInstallLoading(true);
          await dependenciesStore.install();
          await dependenciesStore.setInstallLoading(false);
    
          fetch();
        }
    
        install();
      }
    
      return 
        <div>
          {dependenciesStore.installError}
          <button onClick={onInstall} disable={dependenciesStore.installLoading}>
            安装新依赖
          </button>
          {
            dependenciesStore.refreshLoading ? 
              '加载中' :  
              !dependenciesStore.refreshError ? 
                <div>
                  {dependenciesStore.dataSource.map(({name, id}) => {
                    return <div>
                      {name}
                    </div>;
                  })}
                </div> : 
                null
          }
        </div>
    };
    

    问题

    • 该逻辑的处理如果在业务层,则比较恶心;是否可以在 icestore 层面做,如果在业务层面做怎么做更好?
    • 如果在 icestore 层面做,怎么做?

    思路

    通常一个异步方法有以下状态:

    • 该方法未调用;
    • 该方法在调用中;
    • 该方法调用完成。

    在我们的实际场景中,我们关心的是该方法是否在调用中,该方法调用是否成功,如果有错误,错误是什么。

    方案

    在每个异步方法后面挂载字段用于标识方法的执行状态,然后前端通过这些字段去进行状态判断及进行视图处理。

    • 该方法在调用中: pending;
    • 该方法调用完成后是否有错误:error。

    示例代码

    // store
    export default {
      dataSource: [],
    
      async refresh() {
        this.dataSource = await (await fetch(/* api */)).json();
    
        // 如果是根据接口的返回值确定成功与否状态:
        /*
        const result = await (await fetch()).json();
    
        if (result.error) {
          throw new Error(data.error);
        } else {
          this.dataSource = result.dataSource;
        }
        */
      },
    
      async install(data) {
        await fetch(/* api */, data);
      },
    };
    
    // view
    import stores from '@src/stores';
    
    const Component = () => {
      const dependenciesStore = stores.useStores('dependencies'); 
    
      useEffect(() => {
        dependenciesStore.refresh();
      }, []);
    
      function onInstall() {
        async function install() {
          await dependenciesStore.install();
          await dependenciesStore.refresh();
        }
    
        install();
      }
    
      return 
        <div>
          {dependenciesStore.install.error}
          <button onClick={onInstall} disable={dependenciesStore.install.pending}>
            安装新依赖
          </button>
          {
            dependenciesStore.refresh.pending ? 
              '加载中' :  
              !dependenciesStore.refresh.error ? 
                <div>
                  {dependenciesStore.dataSource.map(({name, id}) => {
                    return <div>
                      {name}
                    </div>;
                  })}
                </div> : 
                null
          }
        </div>
    };
    

    默认每个异步方法都会有该状态且触发两次视图的刷新

    • 第一次:异步方法执行前,将方法的 pending 属性赋值为 true;
    • 第二次:异步方法执行后,将方法的 pending 属性赋值为 false,如果失败则将方法的 error 属性赋值为 Error。

    可以在全局设置禁止异步状态的刷新:

    import Icestore from '@ice/store';
    
    const icestore = new Icestore();
    icestore.disableAsyncStatus = true;
    

    也可以在方法调用前禁止该次调用的异步状态的刷新:

    import stores from '@src/stores';
    
    const Component = () => {
      const dependenciesStore = stores.useStores('dependencies'); 
    
      useEffect(() => {
        dependenciesStore.refresh.disableAsyncStatus = true;
        dependenciesStore.refresh();
      }, []);
    
      return null;
    };
    
    opened by alvinhui 22
  • ICELAND 可视化区块搭建 Beta 版本使用手册

    ICELAND 可视化区块搭建 Beta 版本使用手册

    特性介绍

    Iceland 是一个搭建产品,帮助搭建者基于丰富的物料快速拖拽出想要的区块,重新定义前端区块搭建流程,使区块搭建更加智能化。

    产品集成了海量高质量物料,全程可视化搭建,代码一键生成,区块一键导入页面等特性,提供了区块搭建的全新解决方案。

    产品目前还处于测试阶段,我们将持续倾听用户诉求,朝着搭建智能化的目标不断更新,如果使用过程中存在问题,请钉钉扫描最下方二维码加入飞冰交流群,随时向我们反馈。

    快速开始

    这部分将引导你通过 Iceland 快速搭建一个简单的区块,并通过 Iceworks 用它生成你的页面,使你快速体验到可视化搭建的魅力。

    本文档只对搭建自定义区块到生成页面整个操作流程做一个简单的介绍,Iceland 的更多特性和用法,用户可以在实际使用中继续发掘。

    新建区块

    首先启动 Iceworks ,打开【区块】页面,选择【自定义区块】选项卡;

    点击【新建自定义区块】,为区块命名,点击【创建区块】;

    下载必要的物料数据后,弹出 Iceland 搭建页面。

    添加选项卡

    接下来让我们用 Iceland 搭建一个带搜索的选项卡区块,首先点击物料面板上的【组件】按钮,选择【选项卡】分类或在【搜索栏】搜索选项卡,将选项卡添加到画布;

    通过拖拽或者调整属性面板的属性的方式,调整选项卡的宽度,接着点击图层面板中的【选项卡面板】图层,调整选项卡的高度,在【选项卡】图层的属性面板的【属性配置】中可以修改选项卡的标题。

    进阶技巧:

    1. 觉得图层面板好多图层的名字都一样,分辨不清怎么办?

      答:双击图层面板里的图层可以对图层进行重命名

    2. 觉得调整属性好麻烦,只想靠拖拽解决一切怎么办?

      答:点击标尺可以设置参考线,用参考线辅助组件固定位置

    添加输入框

    接下来让我们添加输入框,首先在物料面板点击【组件】按钮,通过搜索或选择分类的方式找到【主要搜索框】组件,添加组件到画布中,在属性面板的【属性配置】中可以修改搜索框的内容;

    可选步骤:

    1. 鼠标框选画布中的多个图层,或者 Cmd/Ctrl + 鼠标点击多选图层,通过右上角菜单面板的【群组】按钮将图层整合为一组;

    进阶技巧:

    1. 有时添加组件到画布上,却点不到组件是为什么?

      答:可能是图层被覆盖住了,可以通过右上角菜单面板的【排序】按钮重排顺序;

    接下来我们可以在物料面板的【图标】项添加 iconfont ,在【元件】面板添加富文本或其他内容,或调整组件颜色等方式美化完善我们的区块,这部分可根据自己需要进行,就不再演示了;

    区块生成页面

    点击【预览】按钮,可以查看我们的区块在前端展示的效果,点击【截图并保存】保存我们的区块;

    关闭搭建页面,回到 Iceworks ,在生成页面界面选择我们的自定义区块,就可以将你自己搭建的区块转换成代码;

    新特性-Table搭建

    功能

    • 画布Editor可以进行删除与加减行列的操作
    • 可以选中单元格进入单元格搭建模式,单元格中可以添加任意复杂组件
    • 支持对每行的单元格中的组件进行差异化的属性配置,满足多样化的设计需求

    画布Editor

    • 选中Table后会在Table显示一个操作层Editor,按区域划分分成四个区域
      • 表格选择区
        • 选中该区域时属性面板上显示Table的属性面板,在对Table自身的属性进行配置之外,还可以对整体的行列进行加减操作。

    • 列选择区
      • 选中该区域时点击右边的箭头展示配置menu,可以进行加减列操作,同时属性面板显示列对应的属性面板

    • 行选择区
      • 选中该区域时点击下边的箭头展示配置menu,可以进行加减行操作,同时属性面板显示行对应的属性面板,可以调整行高

    • 单元格选择区
      • 点击单元格选择区,进入单元格编辑模式,弹出一个黑色透明蒙层,可以从组件面板中添加组件到单元格中,点击蒙层时退出单元格编辑模式

    注:单元格编辑模式中的一些联动说明

    • 在单元格中对组件进行删除操作时,会将同一行其他所有其他单元格中相应组件删除
    • 进行移动操作时,会改变同行中其他单元格的位置
    • 只有改变组件属性时不会影响到其他单元格

    如果使用过程中遇到任何问题或者有对产品的建议,欢迎扫码加入答疑钉钉群向我们反馈:

    discussion 
    opened by Empireo 21
  • [RFC] icejs 国际化方案

    [RFC] icejs 国际化方案

    locale

    支持在 icejs 应用中快速开启国际化功能。

    快速开始

    安装插件

    $ npm i build-plugin-ice-i18n -D
    

    使用

    build.json 中使用插件:

    {
      "plugins": [
        [
          "build-plugin-ice-i18n", {
            "locales": ["en-US", "zh-CN"],
            "defaultLocale": "zh-CN"
          }
        ]
      ]
    }
    

    上面的 en-USzh-CN 是国际化语言的缩写,它们均遵循标准的UTS 语言标识符。比如:

    • zh-CN:中文(中国)
    • zh-HK:中文(香港)
    • en-US:英文(美国)
    • de: 德文

    插件选项

    • locales: 必填,该应用支持的国际化语言;
    • defaultLocale: 必填,该应用默认的国际化语言;
    • i18nRouting: 选填,默认值是 true。设置为 false 后,则将关闭国际化路由;
    • redirect: 选填,默认值是 false。设置为 true 后,则将重定向到偏好语言对应的页面。

    国际化路由

    国际化路由是指在页面路由中包含当前页面的国际化语言。开启该插件后,ice.js 会自动处理路由。

    举个例子,假如在 src/routes.ts 有以下的路由配置:

    const routerConfig = [
      {
        path: '/home',
        exact: true,
        component: Home,
      },
    ]
    

    同时在 build.json 中有以下配置:

    {
      "plugins": [
        [
          "build-plugin-ice-i18n", {
            "locales": ["en-US", "zh-CN", "nl-NL"],
            "defaultLocale": "zh-CN"
          }
        ]
      ]
    }
    

    则以下路由是可访问的:

    • /home:显示 zh-CN 语言,默认语言没有前缀路由;
    • /en-US/home:显示 en-US 语言;
    • /nl-NL/home:显示 nl-NL 语言。

    关闭国际化路由

    插件默认开启国际化路由。如需关闭,则需要在 build.json 中增加以下配置:

    {
      "plugins": [
        [
          "build-plugin-ice-i18n", {
            "locales": ["en-US", "zh-CN"],
            "defaultLocale": "zh-CN",
    +       "i18nRouting": false 
          }
        ]
      ]
    }
    

    获取语言信息

    useLocale

    useLocale hook 用于在组件中获取和修改语言信息。

    import { useLocale } from 'ice';
    
    function Home() {
      const [locale, setLocale] = useLocale();
      
      console.log('locale: ', locale);  // 'en-US'
      return (
        {/* 切换语言为 zh-CN */}
        <div onClick={() => setLocale('zh-CN')}>Set zh-CN</div>
      )
    }
    

    调用 setLocale 方法时,将更新 cookie 中的 ice_locale 的值。

    getLocale

    getLocale 用于获取当前页面的语言。

    import { getLocale } from 'ice';
    
    console.log(getLocale()); // 'zh-CN'
    

    getAllLocales

    getAllLocales 用于获取当前配置的所有语言。

    import { getAllLocales } from 'ice';
    
    console.log(getAllLocales()); // ['zh-CN', 'en-US']
    

    getDefaultLocale

    getDefaultLocale 用于获取默认配置的语言。

    import { getDefaultLocale } from 'ice';
    
    console.log(getDefaultLocale()); // 'zh-CN'
    

    使用 i18n 库

    插件不耦合任何 i18n 库,用户可以自行选择。目前社区比较流行的 i18n 库有 react-intl, react-i18next 等等。

    在 icejs 中使用 i18n 库很简单,以 react-intl 为例:

    // src/app.ts
    import { IntlProvider } from 'react-intl';
    import { useLocale } from 'ice';
    import { messages } from './locales';
    
    function LocaleProvider({ children }) {
      const [locale] = useLocale();
      const defaultLocale = getDefaultLocale();
    
      return (
        <IntlProvider 
          messages={messages[locale]} 
          locale={locale}
          defaultLocale={defaultLocale}
        >
          {children}
        </IntlProvider>
      );
    }
    
    const appConfig = {
      app: {
        addProvider: ({ children }) => {
          return (
            {/* 添加 Provider */}
          	<LocaleProvider>{children}</LocaleProvider>
          )
        }
      }
    }
    
    // src/locales/index.ts
    import { LOCALES } from './locales';
    
    const LOCALES = {
      ENGLISH: 'en-US',
      ZH_CN: 'zh-CN'
    };
    
    const messages = {
      [LOCALES.ENGLISH]: {
        homeTitle: 'Home',
        aboutTitle: 'About',
      },
      [LOCALES.ZH_CN]: {
        homeTitle: '首页',
        aboutTitle: '关于',
      },
    };
    

    切换路由

    我们可以使用 <Link> 组件或者 history.push/replace 进行路由切换:

    import { useLocale, getAllLocales, Link, useLocation } from 'ice';
    
    export default function LocaleSwitcher() {
      const location = useLocation();
      const [activeLocale, setLocale] = useLocale();
      const allLocales = getAllLocales();
      const otherLocales = allLocales.filter((locale) => activeLocale !== locale);
    
      function switchAboutZHCNPage () {
        history.push('/about');
        setLocale('zh-CN');
      }
      return (
        <div>
          <div onClick={() => switchAboutZHCNPage()}>
            切换到中文
         </div>
         <ul>
            {
              otherLocales.map((locale: string) => {
                return (
                  <li key={locale}>
                    <Link 
                      to={location.pathname}
                      onClick={() => setLocale(locale)}>
                      {locale}
                    </Link>
                  </li>
                );
              })
            }
          </ul>
        </div>
      );
    }
    
    

    自动重定向

    根据当前语言环境自动跳转到对应的国际化路由。其中,语言环境的识别顺序的规则如下:

    • CSR:cookie 中 ice_locale 的值 > window.navigator.language > defaultLocale
    • SSR:cookie 中 ice_locale 的值 > res 的 Header 中的 Accept-Language > defaultLocale

    build.json 开启方式如下:

    {
      "plugins": [
        [
          "build-plugin-ice-i18n", {
            "locales": ["en-US", "zh-CN"],
            "defaultLocale": "zh-CN",
    +       "redirect": true 
          }
        ]
      ]
    }
    

    SSG

    SSG 场景下,将根据在 build.json 中配置的 locales 字段,在 build 阶段会生成不同国际化语言对应的 html:

    ├── build
    |  ├── 404.html
    |  ├── about
    |  |  └── index.html
    |  ├── en-US
    |  |  ├── about
    |  |  |  └── index.html
    |  |  └── index.html
    |  ├── index.html
    

    参考链接

    • nextjs i18n-routing:https://nextjs.org/docs/advanced-features/i18n-routing
    • umi locale 文档:https://umijs.org/zh-CN/plugins/plugin-locale
    • umi locale RFC:https://github.com/umijs/umi-next/issues/7
    • nextjs-i18n-example:https://github.com/luhc228/nextjs-i18n-app
    💥 Big Bang feature request 
    opened by luhc228 17
  • 单元测试

    单元测试

    Do you want to request a feature or report a bug? feature What is the current behavior? 基于iceworks创建的项目,按照ice的方式创建了services+models+components,现在想要测试services等文件夹下的内容

    jest示例 `import listService from '../../services/list'

    test('SearchInput tag selector', () => { const data = listService.fetchList() expect(data).not.toBeNull }) `

    • icejs version:6.14.6
    • Node verson:12.18.2

    What is the expected behavior?

    "test": "icejs test --jest-coverage", 运行测试:npm run test

    `
    Test suite failed to run

    Cannot find module '$ice/history' from 'history.ts'
    
    However, Jest was able to find:
        '../xxxxxxx/.ice/history.ts'
    
    You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
    
    See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
    
    However, Jest was able to find:
        '../xxxxxx/.ice/runtimeModule.tsx'
    
    You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
    
    See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
    
    However, Jest was able to find:
        '..xxx/.ice/createApp.tsx'
    
    You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
    
    See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
    
    However, Jest was able to find:
        '../xxxx/services/list.jsx'
    You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
    
    See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
    
    > 1 | import {
        | ^
      2 |   createBrowserHistory,
      3 |   createHashHistory,
      4 |   createMemoryHistory,
    
      at Resolver.resolveModule (node_modules/@alib/build-scripts/node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (.ice/history.ts:1:1)
    

    `

    怎么才能测试services下面的方法以及components下的组件

    enhancement 
    opened by Gamehu 17
  • 构建产物js不执行

    构建产物js不执行

    通过npm create ice选择Web Lite Scaffold初始化ice3项目,浏览器访问构建产物build/index.html 会发现默认模板代码的按钮点击事件无响应 image 如果关闭ssr和ssg,页面会白屏 猜测js并未执行,导致了第一种情况的点击无反应和第二种情况的的白屏问题

    期望表现:正常渲染

    opened by kiscall 1
  • 【RFC】build-plugin-component umd模式支持dist 也起服务

    【RFC】build-plugin-component umd模式支持dist 也起服务

    需求背景

    icestark 推荐用build-scripts框架来启动微模块,然后被icestark微模块使用。

    微模块加载器通过加载 http://${url}/index.js 来加载微模块资源

    大部分情况下,在线上或者预发环境 想直接调试和开发本地代码。 由于当前build-plugin-component 打包出来umd是 dist 文件目录,但不会启动服务,服务被占用了demo.

    建议另外启动一个dist文件的server,譬如:http://127.0.0.1:3334

    opened by younyzhu 0
  • [WIP] Release/3.0.5

    [WIP] Release/3.0.5

    • feat: support env of target and renderer
    • fix: error occur when disable SSR and SSG
    • feat(miniapp): support app and page native events
    • fix: pageConfig do not work when added to a new route
    • feat: support split page chunk when compile server bundle
    opened by ClarkXia 0
Releases(v3.0.4)
  • v3.0.4(Dec 27, 2022)

    • Feat: support Nodejs 18 #5714
    • Feat: reduce code size by externalHelpers #5730
    • Feat: friendly log for developer #5690
    • Fix: refactor server compiler of alias #5732
    • Fix: re-compiler modules which depended by dataLoader #5709
    • Fix: bump version of esbuild (0.14 -> 0.16) and support incremental build of server compiler #5708
    • Fix: the error of switching route in react 16 #5739
    • Fix: hydate did not match when use SSG #5724
    • Fix: compile data-loader.js to lower es version #5758
    Source code(tar.gz)
    Source code(zip)
  • v3.0.3(Dec 15, 2022)

    Configurate plugin to your ice.config.mts

    import { defineConfig } from '@ice/app';
    import icestark from '@ice/plugin-icestark';
    
    export default defineConfig(() => ({
      plugins: [
        icestark({ type: 'framework' }),
      ],
    }));
    

    Visit readme for details.

    • Feat: support pha prefetch defined in dataLoader
    • Fix: optimize log and fix unhandled error makes HMR failed https://github.com/alibaba/ice/issues/5654 #5688
    • Fix: error url output when enable hash router #5678
    • Fix: VisibilityChange do not work with child element #5693
    • Fix: data loader when render mode is SSG #5682
    • Fix: process exit when error occur of mock file #5658
    Source code(tar.gz)
    Source code(zip)
  • v3.0.2(Dec 8, 2022)

    • Fix: mainFields of server compiler https://github.com/alibaba/ice/issues/5626
    • Fix: chunk name rule of lazy page component https://github.com/alibaba/ice/issues/5655
    • Fix: format core-js path when config polyfill https://github.com/alibaba/ice/pull/5648
    • Fix: remove error import warning when config polyfill: usage https://github.com/alibaba/ice/issues/5650
    • Fix: failed to use env in ice.config.mts https://github.com/alibaba/ice/issues/5637
    • Fix: do not detect port which configured #5664

    Visit RP for details.

    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Nov 29, 2022)

    • Feat: support multiple runtime entry of development #5596
    • Fix: external rule for director apis when pack server bundles #5572
    • Fix: reduce bundle size of data-loader #5577
    • Fix: optimize server bundles when development #5556
    • Fix: bump version of built-in dependencies, including @swc/core, webpack #5596
    • Fix: failed to get route config when re-define route path #5609
    • Fix: support custom config file #5622
    • Fix: add temp file to cache directory #5623
    • Fix: merge window content inject by component Script and Data #5630
    • Fix: file resolve when compile css in server compiler #5632
    • Refactor: lock pack dependencies in @ice/bundles, update swc plugins to reduce install size. #5616
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Nov 17, 2022)

    🎉🎉🎉 Announcement on ice.js 3.0, Visit 📚 Docs for details.

    Core Changes

    • New runtime for react 18 and react-router v6
    • Pre-render pages at build time (SSG) or request time (SSR) for default
    • Improve user experience with features such as dataLoader, script prefetch and etc
    • Multi-End Support, both web, Miniapp and Weex
    • New plugin system provides rich features and allow the community to build reusable solutions
    • 2x faster update then ice.js 2.x in mode webpack
    • Full type support for both runtime and build config
    Source code(tar.gz)
    Source code(zip)
  • v2.6.7(Sep 28, 2022)

    BugFix:

    • do not remove origin output css when config cssChunkNames #5490
    • compatible with router false of plugin-icestark #5491
    • compatible with webpack4 hash type #5478
    Source code(tar.gz)
    Source code(zip)
  • v2.6.6(Sep 14, 2022)

    • feat: add i18n cookie options #5471
    • feat: support ssr nodeExternals #5474
    • fix: not get the real component when enable i18n #5428
    • fix: not await dynamic chunks load #5468
    • fix: some i18n bugs #5400
    Source code(tar.gz)
    Source code(zip)
  • v2.6.5(Aug 11, 2022)

    • Feat: support type definition of store by createModel #5443
    • Fix: do not minify source in folder public when build #5308
    • Fix: duplicate interceptor used when load App as a sub app #5321
    • Fix: problems with parse paths specified in url of css files #5350
    • Fix: getInitialProps and getStaticPath do not execute in mode SSR #5398 #5325
    • Fix: compatible to toString() function #5399
    • Fix: compatible with undefined proxy #5369
    • Fix: use fullhash replace of hash in webpack mode #5407
    • Feat: add options forceLocal of extract-css-assets plugin #5378
    • Feat: top-level warning in vite mode #5447
    • Chore: fix types of plugin-auth #5328
    Source code(tar.gz)
    Source code(zip)
  • v1.18.6(Jun 27, 2022)

  • v2.6.4(Apr 28, 2022)

  • v2.6.3(Apr 14, 2022)

    Feat: support framworke alias in mode vite. Relates to #5245 Fix: miniapp app lifecycle is invalid. Relates to #5263 Fix: pre-analyze for js/jsx file. Relates to #5270 Fix: default config of conditionNames #5277 Chore: optimize compile log in mode vite. Relates to #5269

    Source code(tar.gz)
    Source code(zip)
  • v2.6.2(Mar 31, 2022)

    • feat: When memory router is enabled, you can pass initialIndex and initialEntries. Relates to https://github.com/alibaba/ice/pull/5247
    • feat: support setLocale API outer components. Relates to https://github.com/alibaba/ice/pull/5253
    Source code(tar.gz)
    Source code(zip)
  • v2.6.1(Mar 17, 2022)

  • v2.6.0(Mar 10, 2022)

    Improvement

    • Feat: support env vaiables #5164

    ice.js will load additional environment variables from the following files in project root

    .env                # loaded in all cases
    .env.local          # loaded in all cases, recommended ignored by git
    .env.[mode]         # only loaded in specified mode
    .env.[mode].local   # only loaded in specified mode, recommended ignored by git
    

    To prevent accidentally leaking env variables to the client, only variables prefixed with ICE_ are exposed to project code

    • Feat: support rename main css chunk name #5159

    Specify css chunk name in your build.json config:

    {
      "cssChunkNames": "index-main.css"
    }
    

    css main chunk will be always named as index-main.css when build in vite mode

    • Feat: optimize webpack-dev-mock transformer #5162

    speed up mock service by esbuild

    Bug Fix

    • Fix: multi socket for hmr #5129
    • Fix: vitePlugins only take effect when vite is true #5160
    • Fix: escape MockPlugn when --disable-mock in mode vite #5178
    • Fix: disable router should work as usual in mode vite #5181
    • Fix: additional analyze for auth #5209
    Source code(tar.gz)
    Source code(zip)
  • v2.5.1(Jan 18, 2022)

  • v2.5.0(Jan 17, 2022)

    Improvement

    • Feat: support SSR in Vite mode #5045

    Enable SSR feature in Vite mode by config "ssr": true:

    {
      "vite": true,
    +  "ssr": true
    }
    
    • Feat: i18n solution for icejs #4969

    A new plugin for i18n is provided by ICE Team, enable i18n by add plugin build-plugin-ice-i18n

    {
      "plugins": [
        [
          "build-plugin-ice-i18n", {
            "locales": ["en-US", "zh-CN", "nl-NL"],
            "defaultLocale": "zh-CN"
          }
        ]
      ]
    }
    
    • Feat: optimize runtime when build #5082

    Built-in optimization for bundle size, size will reduce more than 20+KB(minified) .

    • Feat: support cli option force to clear cache #5117
    npm start -- --force
    

    or

    - "start": "icejs start"
    + "start": "icejs start --force"
    

    Bug Fix

    • Fix: set content-type for html output #5110
    • Fix: compatible for src/main input when using vite-plugin-index-html #5104
    • Fix: plugin-store use the incorrect alias #5113
    • Fix: swc mode error #5143
    Source code(tar.gz)
    Source code(zip)
  • v2.4.3(Dec 30, 2021)

    Improvement

    • Feat: pass page props to NoAuthFallback component #5088

    Bug Fix

    • Fix: circular dependence of lazy when run test #5077
    • Fix: open blank page in Vite mode #5086
    • Fix: error timing to call after.start.devServer in Vite mode #5085
    • Fix: oom when run ci workflow #5049
    Source code(tar.gz)
    Source code(zip)
  • v2.4.2(Dec 23, 2021)

    Improvement

    • Feat: support specify rootDir for ice.js #5051

    Bug Fix

    • Fix: lazy import is invalid with swc #5060
    • Fix: style import for multiple components with stylePath #5062
    • Fix: add proxy listeners if exists #5059
    Source code(tar.gz)
    Source code(zip)
  • v2.4.1(Dec 16, 2021)

    Bug Fix

    • fix: build error in win32 system #5043
    • fix: error redirection when import specifier from ice with alias #5042
    • fix: set proxy to false when all proxy rule is disabled #5037
    • fix: enhance alias for node_modules dependencies #5028
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Dec 9, 2021)

    Improvement

    • Feat: support output build-speed for each mode (Vite & Webpack) #4977
    • Feat: pre-bundle webpack-dev-server, webpack loaders and plugins depended by built-in plugins #5019
    • Feat: custom component props (props.pageConfig) for each page #4989
    • Feat: support IP address when enable https #5011

    Bug Fix

    • Fix: built-in polyfill for globalThis in mode vite #4991
    • Fix: compatible with win32 system #5017 #5013
    • Fix: SSR error in production #5012
    Source code(tar.gz)
    Source code(zip)
  • v2.3.1(Dec 9, 2021)

  • v2.3.0(Dec 2, 2021)

    Improvement

    • refactor: optimize router render, support different config for router #4814
    • feat: lock npm version of ice dependencies #4986
    • chore: add test case for formatRoutes #4946

    Bug Fix

    • fix: support SSR when use renderComponent #4987
    • chore: avoid show tabbar in every page #4974
    • chore: avoid render error when add el to body #4959
    Source code(tar.gz)
    Source code(zip)
  • v2.2.3(Nov 25, 2021)

    Bug Fix

    • Fix: support config devServer.historyApiFallback #4963
    • Fix: compatible with special chars in html #4962
    • Fix: compatible with disable runtime when config mpa #4961
    • Fix: match the correct pathname of mock server #4960
    • Fix: re-calculate webpack cache id when config disableRuntime #4972
    • Fix: refactor miniapp page component #4867
    • Fix: TabBar resolve path and remove jsx+ for TabBar render #4957
    Source code(tar.gz)
    Source code(zip)
  • v2.2.2(Nov 23, 2021)

  • v2.2.1(Nov 19, 2021)

  • v2.2.0(Nov 18, 2021)

    Features

    • Feat: optimize babel plugin in mode vite #4892
    • Feat: support nested rule in css #4876
    • Feat: support lifecycle of after.start.devServer for mode vite #4905
    • Feat: generate ts type file d.ts for init project #4809

    Bug Fix

    • Fix: disable default file lint for hmr performace #4933
    • Fix: babel config for class property #4925
    • Fix: MPA entry redirection #4924
    • Fix: redirect import from ice in mode vite #4919
    • Fix: support transform proxy.pathRewrite #4920
    • Fix: prevent minize sass file by default #4884
    • Fix: alias in mode vite #4890
    • Fix: postcssOptions in mode vite #4910
    • Fix: regexp for ignore watching runtime folder #4877
    • Fix: error occurred when config both externals and remoteRuntime #4883
    • Fix: SSR does not works in file-system routing #4874
    • Chore: remove unnecessary swc precompile #4895
    Source code(tar.gz)
    Source code(zip)
  • v2.1.3(Nov 12, 2021)

  • v2.1.2(Nov 4, 2021)

    Features

    • feat: query loader for mode webpack #4680

    Bug Fix

    • fix: release [email protected] #4817
    • fix: error occured when config sourceMap #4779
    • fix: transform postcssOptions for vite #4832
    • fix: typo of vitePlugins #4851
    • fix: should not render tabbar in frm #4842
    • fix: filter file when hot update when lint file #4854
    • chore: bump version of esbuild #4846
    • chore: update node engines #4745
    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Oct 28, 2021)

    Features

    • feat: support auto load styl style (#4692 #4801)

    Bug Fix

    • fix: compatible with rax app build (#4790)
    • fix: deprecate check of componentConfig when import style path (#4789)
    • fix: support nested route in mode vite (#4787)
    • fix: print urls after server created (#4785)
    • fix: assets rule for static resource (#4782)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Oct 22, 2021)

    Features

    • support configuration tsChecker in mode vite #4740
    • support configuration eslint in mode vite #4747
    • refactor eslint config in mode webpack with eslint-webpack-plugin, remove dependency of eslint #4751
    • compatible with build-plugin-moment-locale in vite #4685

    Bug Fix

    • fix: transform additionalData for pre-processor in mode vite #4736
    • fix: reset cache when build config is changed in mode webpack #4708
    • fix: prevent to read postcss config which unexpected #4711
    • chore: upgade dependencies such as babel, webpack with minor version #4771 #4773
    • fix: assets rule for static resource #4782
    • fix: print urls after server created in mode vite #4785
    • fix: get undefined component of ErrorBoundary in mode MPA #4770
    Source code(tar.gz)
    Source code(zip)
Owner
Alibaba
Alibaba Open Source
Alibaba
Cross platform UI controls for progressive web and hybrid apps (plain JS, jQuery, Angular and React)

Mobiscroll What is Mobiscroll? Mobiscroll is a UI library for progressive webapps and hybrid development. Created with a lot of attention to usability

Mobiscroll 1.5k Dec 31, 2022
A progressive web app to help volunteers track their volunteering activities, register vet concerns and log incident reports.

POOPS - Pets of Older Persons 2022 Introduction This is a Next.js project bootstrapped with create-next-app. Getting Started First, install yarn: npm

Coders for Causes 17 Jan 3, 2023
A curated collection of resources for learning to build Progressive Web Apps 💪

PWA Resources A curated collection of resources for learning to build Progressive Web Apps ?? Curated and maintained with ♥ by the folks at Shareup. W

Shareup 30 Aug 31, 2022
The progressive image loading library for great good!

AntiModerate The progressive image loading library for great good! Reduce loading time of page to less than a second on slow connections by loading an

Jett LaRue 1.5k Dec 20, 2022
A progressive image loading library. Inspired by Medium’s similar technique.

Blurry Image Load Synopsis A lightweight, zero-dependency library that loads images on demand. Until the images are loaded, a very small version of ea

Dominic Brant 32 Dec 10, 2022
A scalable, high-performance feature management and progressive experimentation platform

Introduction & Our Philosophy FeatBit is a scalable, high-performance Feature Management and Progressive Experimentation platform. Feature Management

null 345 Jan 1, 2023
solana-base-app is a base level, including most of the common features and wallet connectivity, try using `npx solana-base-app react my-app`

solana-base-app solana-base-app is for Solana beginners to get them up and running fast. To start run : run npx solana-base-app react my-app change th

UjjwalGupta49 33 Dec 27, 2022
Web3-citizens-app - React application based on smart contract using web3 and MetaMask extention.

Citizens App (web3-react-redux) React application based on smart contract using web3 and MetaMask extention. Start the applicarion Recomend to install

Denys Voloshyn 3 Aug 25, 2022
A quick start Create React App template with react-router-dom, material-ui, gh-pages and firebase

A quick start Create React App template with react-router-dom, material-ui, gh-pages and firebase. With google authentication, routing and deployment capabilities built in.

Hussain Pettiwala 5 Feb 22, 2022
Tesodev-search-app - Personal Search App with React-Hooks

Tesodev-search-app Personal Search App with React-Hooks View on Heroku : [https://tesodev-staff-search-app.herokuapp.com/] Instructions Clone this rep

Rahmi Köse 1 Nov 10, 2022
Awesome books app is a basic website that allows users to add/remove books from a list. It is a single page app (SPA) which allow switching to different pages of the app without page load. Built with JavaScript.

Awesome Books ES6 In this project, I build a basic website that allows users to add/remove books from a list. using ES6 syntax and make it more organi

Abdulhamid 11 Jul 1, 2022
BOOTFLAT is an open source Flat UI KIT based on Bootstrap 3.3.0 CSS framework

BOOTFLAT is an open source Flat UI KIT based on Bootstrap 3.3.0 CSS framework. It provides a faster, easier and less repetitive way for web developers to create elegant web apps.

bootflat 4.3k Dec 25, 2022
Fast & Robust Front-End Micro-framework based on modern standards

Chat on gitter Hello slim.js - your declarative web components library import { Slim } from 'slim-js'; import { tag, template } from 'slim-js/decorato

slim.js 942 Dec 30, 2022
A dead simple JWT-based authentication library for Next.js framework.

nexauth A dead simple JWT-based authentication library for Next.js framework. Getting Started Visit https://betagouv.github.io/nexauth/#/install to ge

beta.gouv.fr 12 Aug 2, 2022
JavaScript framework for creating beautiful, fast and lightweight websites based on flutter way of coding ☜(゚ヮ゚☜)

Welcome to Flutjs project ?? Flutjs is a javascript framework for creating beautiful, fast and lightweight websites. As the name suggests, Flutejs is

Filipe Lukebana 25 Nov 9, 2022
SmartBuilder: A Block-based Visual Programming Framework for Smart Contract Development

SmartBuilder A Block-based Visual Programming Framework for Smart Contract Development Technology stack used SmartBuilder Framework - Google Blockly A

ibelab 4 Mar 29, 2022
Package for creating entity framework in a nodejs project based on Laravel artisan system.

Artisan Structuring system for an ExpressJs project. Version [Production] release 0.2.0 artisan - npm package Dependencies nodejs Installations Instal

Filipe A.S 17 Dec 11, 2022