🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)
addTargetExport
#6861Document
runtime in client bundle #6848dataLoader
is not defined #6849 #6864import { dynamic } from 'ice';
const ComponentA = dynamic(() => import('../components/A'));
const ComponentB = dynamic(() => import('../components/B'));
const ComponentC = dynamic(() => import('../components/C'), { ssr: false });
export default function Home({ show }) {
return (
<>
{/* load immediately, but in a separate client bundle */}
<ComponentA />
{/* load only the show is true */}
{show && <ComponentB />}
{/* load only on the client side */}
<ComponentC />
</>
);
}
Kudos to @HomyeeKing .
KeepAliveOutlet
#6819import { KeepAliveOutlet } from 'ice';
export default function Layout() {
return (
<div>
<h2>Layout</h2>
{/* limit is the limitation number of outlets to keep alive. */}
{/* when paths is configured, only the specified paths will be kept alive. */}
<KeepAliveOutlet limit={2} paths={['/home']} />
</div>
);
}
ice start -- --plugin @ice/plugin-analyze
data-loader
( speedup mode only) #6804rax-compat
#6814plugin-rax-compat
including, support option inlineStyle in SSR and inline style for both less and scss.swcrc
#6746Improve the build speed by implement customize Rspack plugins and loaders by Rust. The build speed and HMR has been significantly improved in speedup mode. PR #6680
@ice/pack-binding
which is based on RspackFeat: support plugin of Unocss #6665
Install @ice/plugin-unocss
:
$ npm install @ice/plugin-unocss --save-dev
Configure it in ice.config.mts
:
import { defineConfig } from '@ice/app';
import Unocss from '@ice/plugin-unocss';
export default defineConfig(() => ({
plugins: [
Unocss(),
]
}));
Plugin has a default preset @unocss/preset-uno
for UnoCSS.
Feat: add default export of rax-compat #6643
Fix: better error handling of build script #6672
Chore: remove type exports #6651
Fix: re-order transform plugins #6649