What do you mean? This is a desktop component.
Just to clarify - I know inline PDF previews are still supported in Discourse.
My question is specifically about the theme component itself - it currently throws deprecation warnings in the console on recent Discourse versions.
Would this need a PR to update the deprecated API usage (e.g. plugin API / Ember hooks), or is there already work underway to modernize it?
Since it’s marked official , it’s reasonable to assume that it’ll be updated before it’s too late.
A post was split to a new topic: Gating system similar to Scribd
Yeah, my feature PR above fixes the deprecated API. However, it needs more work, and I’ve been too busy to look at it again.
I’m disappointed that the viewing of a pdf on a mobile device is not permitted. I’m hoping to migrate my phpBB site to Discourse, because phpBB is clunky - but, I’ve hacked a feature into my board using pdf.js that permits me to embed pdfs. And pdf.js permits you to zoom and pan - while it’s not as robust as on the desktop, it’s useful in the garage to scan a manual without having to run back into the house. This example is not that of a manual, but demonstrates the principle: Bulletin #361 - A Diesel in America
Facebook is eating my lunch, and primarily with mobile devices - I’m hoping to win users back with a Discourse integration. But losing pdf on the handheld is not a win for me.
-Dan
Console throws discourse.static-viewport-initialization deprecation warning.
log_manager.js:98 [Gemini Nexus] Background Service Worker Started
index.js:4 Gemini Nexus v4.2.3 Ready
runtime.ts:81 DEPRECATION: Importing `inject` from `@ember/service` is deprecated. Please import `service` instead. [deprecation id: importing-inject-from-ember-service] This will be removed in ember-source 7.0.0. See https://deprecations.emberjs.com/id/importing-inject-from-ember-service for more details.
(anonymous) @ deprecate.js:72
s.<computed> @ handlers.js:10
(anonymous) @ deprecate.js:108
s.<computed> @ handlers.js:10
(anonymous) @ deprecate.js:116
s.<computed> @ handlers.js:10
(anonymous) @ index.js:75
(anonymous) @ index.js:110
s.<computed> @ handlers.js:10
(anonymous) @ index.js:115
s.<computed> @ handlers.js:10
r @ handlers.js:19
l @ deprecate.js:189
k @ index.js:31
p @ index.js:126
o @ index.js:31
n @ runtime.ts:81
<static_initializer> @ external-link-confirm.gjs:18
(anonymous) @ external-link-confirm.gjs:18
app.js:297 ℹ️ Discourse v2026.1.0-latest — https://github.com/discourse/discourse/commits/1c90b0dd85 — Ember v6.6.0
deprecated.js:52 DEPRECATION NOTICE: Accessing `site.mobileView` or `site.desktopView` during the site initialization can lead to errors and inconsistencies when the browser window is resized. Please move these checks to a component, transformer, or API callback that executes during page rendering. [deprecated since Discourse 3.5.0.beta9-dev] [deprecation id: discourse.static-viewport-initialization] [info: https://meta.discourse.org/t/367810]
d @ deprecated.js:52
get mobileView @ site.js:123
(anonymous) @ compat.js:22
X @ index.js:416
i.get @ compat.js:21
(anonymous) @ initialize-for-pdf-preview.js:10
eH @ plugin-api.gjs:3363
initialize @ initialize-for-pdf-preview.js:9
i.initialize @ app.js:265
(anonymous) @ index.js:379
e.each @ index.js:183
e.walk @ index.js:112
e.each @ index.js:59
e.topsort @ index.js:65
_runInitializer @ index.js:392
runInstanceInitializers @ index.js:377
_bootSync @ instance.js:116
didBecomeReady @ index.js:784
invoke @ index.js:262
flush @ index.js:180
flush @ index.js:334
_end @ index.js:762
_boundAutorunEnd @ index.js:499
Promise.then
(anonymous) @ index.js:18
flush @ index.js:29
_scheduleAutorun @ index.js:928
_ensureInstance @ index.js:919
schedule @ index.js:618
f @ index.js:343
waitForDOMReady @ index.js:512
init @ index.js:412
_ @ core.js:97
create @ core.js:599
(anonymous) @ start-app.js:18
await in (anonymous)
(anonymous) @ discourse-boot.js:13
(anonymous) @ discourse-boot.js:1
loader.js:46 Lazy dependencies loading...
이 컴포넌트에 모바일 지원 및 PDF.js 통합을 추가하는 PR을 5주 이상 전에 제출했지만, 아직 피드백을 받지 못했습니다. 다른 분들에게도 유용할 수 있을 것 같아 개선된 포크를 공유합니다:
주요 개선 사항:
- 모바일 기기 지원 (모바일 차단 제거)
- 페이지 탐색 및 줌 컨트롤을 갖춘 PDF.js 렌더링
- “새 탭” 모드에서의 썸네일 미리보기
- .attachment 클래스가 없는 PDF와 호환 (마이그레이션에 유용)
- 모바일 핀치 줌(Pinch-to-zoom) 지원
저는 59plymouth.net에서 변환된 phpBB 콘텐츠와 함께 이 포크를 2개월 이상 사용해 왔으며, 데스크톱과 모바일 모두에서 훌륭하게 작동합니다.
설치 방법: 관리자 → 외관 → 테마 → Git에서 설치 → 위의 URL 붙여넣기
유지보수자들이 검토하기를 원한다면 PR은 여전히 열려 있습니다: Add PDF.js integration with mobile support - Pull Request #49 - discourse/discourse-pdf-previews - GitHub
여러분,
해당 컴포넌트를 사용하다가 관리자 계정으로 로그인했을 때 이 현상을 발견했습니다:
![]()
GitHub에 올려진 그 PR 설명이 정말 멋집니다!
저도 이 컴포넌트를 여러 곳에서, 그리고 여러 디스커스 사이트에서 사용하고 있어서 데스크톱에서처럼 모바일에서도 잘 작동하면 좋겠습니다. 팀이 곧 PR을 검토해 주셨으면 좋겠네요.
(관리자 공지도 확인했고, 당분간 컴포넌트를 비활성화해 두겠습니다)
github.com/discourse/discourse-pdf-previews
업데이트 확인, 마지막 확인: 9분 전
Default를 제거하여 이 컴포넌트가 설치된 테마가 없도록 함
@tpetrov 이제 수정되었습니다 ![]()
@tobiaseigen 안녕하세요 — 보신 관리자 공지사항은 위에서 논의된 비권장(deprecation) 경고일 가능성이 매우 높으며, 원래 컴포넌트의 구식 모바일 감지 호출에서 발생하는 것입니다. 제 포크는 다른 접근 방식을 취합니다. 해당 호출을 패치하는 대신 모바일 제한을 완전히 제거했습니다(모바일에서 PDF가 렌더링되도록 하는 것이 원래 목적이었으므로) 따라서 해당 비권장 코드 경로가 완전히 사라졌습니다. 또한 최신 업스트림 변경 사항을 제 브랜치에 병합했으므로 최신 상태입니다.
시도해 보고 싶으시다면 git에서 설치할 수 있습니다:
https://github.com/shortmort37/discourse-pdf-previews
— feature/pdfjs-mobile-support 브랜치를 사용하세요(설치 다이얼로그의 “고급” 옵션 아래에 브랜치 필드가 있습니다).
제 테스트 과정에서 얻은 팁 하나: 설치 후 컴포넌트에서 "업데이트 확인"을 한 번 실행한 다음 하드 리프레시를 하세요. Discourse는 컴파일된 테마 JS를 캐시하므로, 이 단계를 통해 현재 코드가 실행되고 있는지 확인할 수 있습니다.
이것은 공식 컴포넌트가 아니라 추가 기능(PDF.js 렌더링, 페이지 내비게이션, 확대/축소, 새 탭 모드에서의 썸네일)이 포함된 제 개인 포크임을 경고합니다. 그리고 이러한 변경 사항을 업스트림에 반영하기 위한 제 PR(#49)은 아직 열려 있으며 검토를 기다리고 있습니다. 궁금한 점이 있으시면 기꺼이 답변해 드리겠습니다.

