# 템플릿 및 JS API를 위한 인라인 스크립트 태그 현대화

**URL:** https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482
**Category:** Development
**Tags:** dev-news
**Created:** [5월 19, 2025, 9:55오전 UTC](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482 "2025-05-19T09:55:17Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [7월 21, 2025, 8:09오전 UTC](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482/17 "2025-07-21T08:09:24Z")

</div>

친근한 알림입니다: post-avatar의 `changeWidgetSetting`은 [비추천(deprecated)된 API이며 곧 제거될 예정입니다](https://meta.discourse.org/t/upcoming-post-stream-changes-how-to-prepare-themes-and-plugins/372063).

아래와 같이 코드를 수정하는 것이 좋습니다.

```gjs
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer((api) => {
  const site = api.container.lookup("service:site");
  if (!site.mobileView) {
    api.modifyClass("component:post/avatar", (SuperClass) => class extends SuperClass {
      get size() { return "70"; } 
    });
  }
});

```

---

_[View the full topic](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482)._
