Ice Versions Save

๐Ÿš€ ice.js: The Progressive App Framework Based On React๏ผˆๅŸบไบŽ React ็š„ๆธ่ฟ›ๅผๅบ”็”จๆก†ๆžถ๏ผ‰

@ice/[email protected]

1 year ago

Patch: revert @swc/core version because of https://github.com/swc-project/swc/issues/7174

@ice/[email protected]

1 year ago
  • Fix: get route assets by route manifest #6083 Close #6078
  • Fix: compatible with undefined value in PHA template #6082 Close #6081
  • Fix: onAppear is undefined in rax-compat mode #6076 Close #6072
  • Chore: env compatible with default export #6095
  • Fix: refactor get route paths for remove unused code #6074 Close #6066
  • Feat: support pullrefresh in PHA #6121 Close #6117
  • Chore: update dependencies #6026

@ice/[email protected]

1 year ago
  • Fix: static resource should not render by SSR middleware #6070
  • Fix: source code of react should not packed in dataLoader #6061
  • Fix: revert build config of PR #6041 , and external node builtin modules by esbuild plugin #6088

@ice/[email protected]

1 year ago
  • Feat: support route index and nested url without nested layout #6003

Support access /about/repo/$id by create route component about.repo.$id.tsx.

โ””โ”€โ”€ src
    โ”œโ”€โ”€ root.jsx
    โ””โ”€โ”€ pages
-       โ”œโ”€โ”€ about
-       โ”‚   โ”œโ”€โ”€ repo
-       โ”‚   โ”‚   โ””โ”€โ”€ $id.tsx
        โ”‚   โ””โ”€โ”€ index.tsx
+       โ””โ”€โ”€ about.repo.$id.tsx

Remain route path by [] which matches routing rules, such as index

route component route
src/pages/[index].tsx /index
src/pages/about/[index].tsx /about/index

Visit docs for more details.

  • Fix: HMR is reliable when develop #6004
  • Fix: build error when use wildcard route #6023 #6022
  • Fix: make sure server env variable is always false when CSR #6002
  • Fix: error caused by dataLoader when navigate #6044 #6039 #5974 #5888
  • Fix: useState parameter of initialState can be function in rax-compat mode #6033
  • Fix: dataLoader build error when config custom fetcher #6035
  • Fix: avoid remount when micro app is loaded in other micro app framework #6036
  • chore: imporve build preformance by using async function #6053
  • chore: add leading slash for basename in case of unexpected config #6058
  • chore: make server.onDemand optional #6010
  • chore: update init cli command for project scaffolds #5720

@ice/[email protected]

1 year ago
  • Feat: support on demand compilation for server code #5823 #5780 @ClarkXia

Enable on demand compile by config ice.config.mts:

import { defineConfig } from '@ice/app';
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
import customPlugin from './plugin';

export default defineConfig(() => ({
  ssr: true,
  server: {
    onDemand: true,
    // Strongly recommand to set esm format when use on demand compilation.
    format: 'esm',
  },
}));
  • Feat: support routes config for custom routing rules. #5852
import { defineConfig } from '@ice/app';

export default defineConfig({
  routes: {
    config: [
      {
        path: 'rewrite',
        // ไปŽ src/page ๅผ€ๅง‹่ฎก็ฎ—่ทฏๅพ„๏ผŒๅนถไธ”้œ€่ฆๅ†™ๅŽ็ผ€
        component: 'sales/layout.tsx',
        children: [
          {
            path: '/favorites',
            component: 'sales/favorites.tsx',
          },
          {
            path: 'overview',
            component: 'sales/overview.tsx',
          },
          {
            path: 'recommends',
            component: 'sales/recommends.tsx',
          },
        ],
      },
      {
        path: '/',
        component: 'index.tsx',
      },
    ],
  },
});

We strongly recommend to use file system routing, which makes routes more predictable and intuitive.

  • Feat: support code spiliting strategy #5957
  • Fix: usage of plugin request #5922 @luhc228
  • Fix: do not compile non-js file when use plugin fusion #5937
  • Fix: support unknown cli options registered by plugins #5989
  • Fix: import path of types and runtime #5981
  • Fix: compile error when declare @jsx createElement comment. Thanks for the PR from @MrpandaLiu
  • Fix: serveral problems when use stream render #5986 #5985 #5984 #5983 #5987 #5988 @chenjun1011
  • Fix: props transformation when use rax-compat #5999
  • Fix: break change for plugin PHA #5955 #5913 @answershuto

@ice/[email protected]

1 year ago
  • Feat: support API for get route manifest getRouteManifest and flatten routes getFlattenRoutes #5915
  • Fix: custom host and port by userConfig and env #5895
  • Fix: dev process exit when compile error occurs #5886
  • Fix: .browserslist do not works for code compilation #5906
  • Fix: pre bundle runtime dependencies with format esm #5935
  • Feat: add generator API for custom document components #5917 #5934
  • Fix: the value of isServer is false when compile dataLoader.js #5897
  • Fix: optimize terminal log #5912 #5859

v3.1.0

1 year ago
  • Feat: ๐Ÿš€ support suspense SSR #5801
// New API from ice for Suspense SSR
import { useSuspenseData, withSuspense } from 'ice';

function Comments() {
  const comments = useSuspenseData(getData);
  return (
    <div>
      {comments.map((comment, i) => (
        <p className="comment" key={i}>
          {comment}
        </p>
      ))}
    </div>
  );
}

export default withSuspense(Comments);

const fakeData = [
  "Wait, it doesn't wait for React to load?",
  'How does this even work?',
  'I like marshmallows',
];

async function getData() {
  await new Promise((resolve) => {
    setTimeout(() => resolve(null), 3000);
  });
  return fakeData;
}
  • Feat: mark ice.js works properly with weex2.0 and support js entry #5615 #5728 #5763
  • Feat: support dynamic dataLoader for PHA #5808
  • Refactor: support keep platform code by alias to runtime generation #5710
  • Fix: build error with use dynamic import #5840
  • Fix: render duplicate element when use rax compat mode #5847
  • Fix: compatible with document with has not meta element #5816
  • Fix: support lifecycle of bootstrap when use @ice/plugin-icestark #5825
  • Fix: set the right target for build data-loader.js #5843
  • Fix: process exit when error occur in development #5827

v3.0.6

1 year ago
  • Feat: support import.meta.target, import.meta.renderer and import.meta.env.* #5700
  • Feat: enhance memory router and support configure routes.injectInitialEntry #5800

Enable routes.injectInitialEntry when deploy memory router app by assets:

import { defineConfig } from '@ice/app';

export default defineConfig(() => ({
  splitChunks: false,
  routes: {
    injectInitialEntry: true,
  },
}));
  • Feat: support jsx runtime in rax compat mode #5803
  • Fix: pageConfig do not work when added to a new route file #5659
  • Fix: rebuild server entry when document changed #5795
  • Fix: remove ast node of ObjectProperties when disable ssg for document render #5785
  • Fix: error occur when disable SSR and SSG #5719
  • Fix(plugin-icestark): modify basename when render as a child app #5810

v3.0.5

1 year ago

HotFix: bump @swc/helpers version to fix compile error #5768

v3.0.4

1 year ago
  • 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