alibaba / alibaba/ice

[RFC] Remove useEffect from the codebase for server bundling

Open
#7,007 0 comments 0 reactions 0 assignees View on GitHub
rfc
Dominant language
TypeScript
Stars
18.6k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

### Summary | 概述

_No response_

### Motivation | 背景

When the bundle runs on the server side, useEffect is not executed. `ICE` can omit any `useEffect` code to reduce the bundle size.

### Usage example | 使用示例

_No response_

### Detailed design | 方案设计

Server React API optimization including `useEffect`, `useLayoutEffect` and `useState`.

Add an SWC plugin to implement this functionality, with special attention to the handling of the bindingScope Indent.
This feature is optional, and it can be active by user config.

### Additional context | 额外信息

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the server bundling path and current SWC plugin configuration; the issue names no files or tests. Verify the optional handling of useEffect, useLayoutEffect, and useState, including bindingScope indent behavior, with completion shown by a reduced server bundle when the option is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
backend, build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.