alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)
https://ice.work
MIT License
17.83k stars 2.09k forks source link

为什么我在引用defineDataLoader之后,热加载的时间就会增加。 #6759

Closed anyone0034 closed 5 months ago

anyone0034 commented 7 months ago

Describe the bug

为什么我在引用defineDataLoader之后,热加载的时间就会增加。如果不引用,平时1s完成热加载,引入之后,就变成7、8s

Expected behavior

热加载的时间,能在正常的范围内。

Actual behavior

import { defineDataLoader, Await, useData, history } from 'ice';

export const dataLoader = defineDataLoader(async () => { return { nickname: "", }; });

Version of ice.js

"devDependencies": { "@applint/spec": "^1.2.3", "@ice/app": "^3.3.9", "@ice/plugin-auth": "^1.0.2", "@ice/plugin-request": "^1.0.2", "@ice/plugin-store": "^1.1.2", "@types/babel__core": "^7", "@types/node": "^20.10.6", "@types/react": "^18.2.46", "@types/react-dom": "^18.2.18", "@types/speed-measure-webpack-plugin": "^1", "eslint": "^8.56.0", "stylelint": "^16.1.0", "typescript": "^5.3.3" },

Content of build.json or ice.config.mts

import { defineConfig } from '@ice/app';
import request from '@ice/plugin-request';
import store from '@ice/plugin-store';
import auth from '@ice/plugin-auth';
const minify = process.env.NODE_ENV === 'production' ? 'swc' : false;
export default defineConfig(() => ({

    compileDependencies: true,
    htmlGenerating: true,

    ssg: false,
    minify,
    plugins: [
        request(),
        store(),
        auth(),

    ],

    routes: {
        defineRoutes: (route) => {

        },
    },

}));

Additional context

No response

ClarkXia commented 7 months ago

能不能提供个复现 demo 供排查

ClarkXia commented 6 months ago

Fixed in #6804