Skip to content

[전수조사/M] React 18·19 지원과 패키지 메타데이터 #691

Open

Description

@owjs3901

peer는 React *이지만 코드는 React 19 전용 기능(use(Context), ref를 일반 prop으로 받기, callback ref cleanup)을 씁니다. 또 React ^19.3이 dependencies에 있어 React 18 앱에 React가 두 벌 설치될 수 있습니다.

전체 계획과 결정 사항은 추적 이슈(#682)에 있습니다. 조사 기준 커밋: 77daad74 (현재 main d0b84255).

결정에 따른 작업

  • (필수) peer ^18 || ^19, dependencies에서 React 제거
  • (필수) use → useContext, 생성 styled 컴포넌트와 UI kit에 forwardRef, callback ref cleanup 대체
  • (필수) React 18 fixture로 CI 검증(이슈 L의 테스트 인프라)

발견 항목

심각도: P0 = 흔한 사용에서 조용히 틀리거나 크래시, P1 = 흔한 패턴이 명시적 에러로 막히거나 드물게 조용히 틀림, P2 = 드문 경우·도구/문서 불일치, P3 = 있으면 좋음.

필수 (5)

  • RT-05 (P0, CRASH) Declared React * compatibility is false and can crash on React 18
    • 근거: both packages advertise peerDependencies.react: "*" while also depending on react:^19.3; useSelect and useStepper call React 19's use(Context), Select relies on React 19 callback-ref cleanup, and public components rely on React 19 ref-as-prop. React 18 requires forwardRef and does not support callback-ref cleanup: https://react.dev/reference/react/forwardRef and htt…
    • 수정 방향: Either require React >=19 and remove React from runtime dependencies, or use React-18-compatible useContext, forwardRef, and effect cleanup.
  • RT-29 (P0, MISMATCH) Package metadata can install a second React while claiming any peer is supported
    • 근거: packages/components/package.json and packages/react/package.json put React ^19.3 in dependencies while also declaring peer react:"*". A React-18 application can satisfy the peer yet receive nested React 19, risking invalid-hook-call/renderer mismatches; the runtime itself uses React-19-only APIs.
    • 수정 방향: Remove React from runtime dependencies and set the truthful peer range (or eliminate React-19-only behavior and test all accepted majors).
  • INF-23 (P1, MISMATCH) Package compatibility claims are unconstrained
    • 근거: all manifests omit engines; React/bundler/Next/WASM/ESLint peers are mostly *; React package depends on ^19.3 while peer says every React and ref behavior is untested.
    • 수정 방향: test and declare minimum/maximum host ranges and engines; avoid both a hard React dependency and unrestricted peer unless intentional.
  • RT-06 (P1, MISMATCH) Public UI-kit components do not forward refs on React 18
    • 근거: Button, Checkbox, Input, Radio, RadioGroup, Textarea, and Toggle are plain function components with no forwardRef; Select/Stepper compound wrappers are likewise plain functions. Their HTML prop types imply normal ref usability, but React 18 strips function-component refs.
    • 수정 방향: Forward refs explicitly or narrow the supported React range/types to React 19 only.
  • SC-13 (P1, WRONG) Generated wrappers do not forward refs on React 16.8-18
    • 근거: 50-ref.tsx transforms styled.input to a plain const X = ({style,className,...rest}) => <input {...rest} .../>; no forwardRef is generated. On React versions supported by styled-components v5/v6 before React 19, a ref is not an ordinary function-component prop, so callers receive no underlying input ref. Devup declares peer react: "*" (packages/react/package.json:81…
    • 수정 방향: Generate forwardRef wrappers for styled components when compatibility with React <=18 is claimed, or narrow peer/support policy to React 19+ and document the break.

권장 (1)

  • INF-10 (P1, MISMATCH) WASM CommonJS export resolves to ESM
    • 근거: bindings/devup-ui-wasm/package.json is type: module; both import and require point to pkg/index.js.
    • 수정 방향: ship a .cjs wrapper or remove the unsupported require condition.

Activity

  1. added
    bugSomething isn't working
    dependenciesPull requests that update a dependency file
    on Sep 30, 2026
  2. owjs3901 commented on Nov 15, 2026

    @owjs3901
    ContributorAuthor

    main(1160bf646)에 병합된 수정을 확인해 체크리스트를 갱신했습니다.

    새로 체크한 항목 (3건 + 결정 항목 2건)

    아직 열린 PR로만 다루는 항목: INF-23 (#940), RT-06 (#913: 남은 컴포넌트의 forwardRef)

    수정이 확인되지 않은 항목: INF-10. main의 bindings/devup-ui-wasm/package.json은 여전히 "type": "module"이고, require가 ./pkg/index.js를 가리킵니다.

    체크하지 않은 결정 항목: use→useContext/forwardRef/callback ref cleanup (RT-06이 남아 있음)

  3. owjs3901 commented on Nov 17, 2026

    @owjs3901
    ContributorAuthor

    Re-verified every item against main a22ed78e0.

    Item Status Evidence
    (decision) peer ^18 || ^19, React out of dependencies done #720. packages/react/package.json and packages/components/package.json peer react: "^18 || ^19", no React in dependencies
    (decision) use → useContext, forwardRef for generated styled + UI kit, replace callback-ref cleanup done (newly ticked) No use( left: packages/components/src/contexts/useSelect.ts:20 and components/Stepper/index.tsx:29 call useContext. Generated styled wrappers: #722. UI kit: every exported DOM component is forwardRef (Button, Checkbox, Input, Radio, Textarea from earlier PRs; Select/SelectContainer/SelectOption/SelectDivider, Toggle, RadioGroup, Stepper parts in #913). No ref callback returns a cleanup: refs are composed with mergeRefs (utils/dom.ts:4) and popup positioning moved to an effect (#741)
    (decision) React 18 fixture in CI done #731, react-18 job in .github/workflows/publish.yml:492
    RT-05, RT-29 done #720
    SC-13 done #722
    RT-06 done (newly ticked) #913 (merged 2026-11-17), with packages/components/src/__tests__/forward-ref.browser.test.tsx. Ran bun test packages/components locally on main: all pass
    INF-10 done (newly ticked): not reproducible bindings/devup-ui-wasm/script.js:101 writes pkg/package.json as {} and package.json:34 ships it, so pkg/index.js (wasm-pack --target nodejs, exports.x = …) is CommonJS despite the root "type": "module". Checked with Node 26: require('@devup-ui/wasm') returns the API functions (e.g. codeExtract), and import of the same entry gives the same functions as named and default exports. The packed-consumer release gate (e2e/release/run.mjs) installs the packed wasm and loads it through plugin-utils' require
    INF-23 still open, partly done #940 added engines and bounded the vite/next/rsbuild/typescript-eslint peers. Left from that PR: no eslint peer on eslint-plugin and next-plugin's @devup-ui/webpack-plugin: "*" peer, fixed in #989 (open). Two points need an owner decision, listed below

    Decisions needed for INF-23 (not changed)

    1. engines for @devup-ui/wasm, @devup-ui/binding* and @devup-ui/bun-plugin. The wasm build imports globalThis.crypto.getRandomValues (boa_engine → rand → getrandom wasm_js), which is only a global from Node 19, while plugin-utils still declares Node >=18. Either raise the floor (Node 18 is EOL) or confirm the call is never reached on Node 18. The bun-plugin has no evidence for a minimum Bun version.
    2. @devup-ui/react lists csstype-extra as dependencies: "latest" and peer "*" (since be1798e04). This looks intentional (always-current CSS types), so I left it.

    main a22ed78e0 기준으로 모든 항목을 다시 확인했습니다.

    항목 상태 근거
    (결정) peer ^18 || ^19, dependencies에서 React 제거 완료 #720. packages/react/package.json, packages/components/package.json의 peer가 react: "^18 || ^19"이고 dependencies에 React 없음
    (결정) use → useContext, 생성 styled와 UI kit에 forwardRef, callback ref cleanup 대체 완료(이번에 체크) use(가 남아 있지 않습니다. packages/components/src/contexts/useSelect.ts:20, components/Stepper/index.tsx:29가 useContext를 씁니다. 생성 styled wrapper는 #722. UI kit은 export되는 DOM 컴포넌트가 모두 forwardRef입니다(Button, Checkbox, Input, Radio, Textarea는 이전 PR, Select/SelectContainer/SelectOption/SelectDivider, Toggle, RadioGroup, Stepper 부품은 #913). cleanup을 반환하는 ref callback은 없습니다. ref는 mergeRefs(utils/dom.ts:4)로 합치고 팝업 위치 계산은 effect로 옮겨졌습니다(#741)
    (결정) React 18 fixture CI 완료 #731, .github/workflows/publish.yml:492의 react-18 job
    RT-05, RT-29 완료 #720
    SC-13 완료 #722
    RT-06 완료(이번에 체크) #913(2026-11-17 병합), packages/components/src/__tests__/forward-ref.browser.test.tsx. main에서 bun test packages/components를 로컬로 돌려 모두 통과
    INF-10 완료(이번에 체크): 재현되지 않음 bindings/devup-ui-wasm/script.js:101이 pkg/package.json을 {}로 쓰고 package.json:34가 이를 배포하므로, 루트가 "type": "module"이어도 pkg/index.js(wasm-pack --target nodejs, exports.x = …)는 CommonJS입니다. Node 26에서 require('@devup-ui/wasm')가 API 함수(codeExtract 등)를 돌려주고, 같은 엔트리를 import하면 named/default export 모두 같은 함수를 줍니다. packed-consumer 릴리스 게이트(e2e/release/run.mjs)도 pack된 wasm을 설치해 plugin-utils의 require로 불러옵니다
    INF-23 미완료, 일부 완료 #940이 engines를 추가하고 vite/next/rsbuild/typescript-eslint peer를 좁혔습니다. 그 PR이 남긴 eslint-plugin의 eslint peer 누락과 next-plugin의 @devup-ui/webpack-plugin: "*" peer는 #989(열림)에서 고칩니다. 아래 두 가지는 오너 결정이 필요합니다

    INF-23에서 결정이 필요한 것 (변경하지 않음)

    1. @devup-ui/wasm, @devup-ui/binding*, @devup-ui/bun-plugin의 engines. wasm 빌드는 globalThis.crypto.getRandomValues를 import하는데(boa_engine → rand → getrandom wasm_js), 이는 Node 19부터 전역입니다. 반면 plugin-utils는 여전히 Node >=18을 선언합니다. 하한을 올리거나(Node 18은 EOL), Node 18에서 이 호출에 도달하지 않음을 확인해야 합니다. bun-plugin은 최소 Bun 버전의 근거가 없습니다.
    2. @devup-ui/react는 csstype-extra를 dependencies: "latest", peer "*"로 둡니다(be1798e04부터). 항상 최신 CSS 타입을 쓰려는 의도로 보여 그대로 두었습니다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions