Skip to content

client/modules/Preview: migrate to TypeScript, no-verify#4117

Open
NalinDalal wants to merge 9 commits into
processing:developfrom
NalinDalal:develop
Open

client/modules/Preview: migrate to TypeScript, no-verify#4117
NalinDalal wants to merge 9 commits into
processing:developfrom
NalinDalal:develop

Conversation

@NalinDalal
Copy link
Copy Markdown

Fixes #3828

Summary

Migrated client/modules/Preview from JavaScript to TypeScript to improve type safety and developer experience.

Changes

Files Converted:

File Description
EmbedFrame.tsx Main preview iframe component with styled-components
filesReducer.ts Redux reducer for managing preview files
previewIndex.tsx Preview entry point

Type Definitions Added

PreviewFile interface (filesReducer.ts:6-16):

interface PreviewFile {
  id: string;
  name: string;
  content: string;
  url?: string;
  blobUrl?: string;
  children: string[];
  filePath?: string;
  fileType?: string;
  _id?: string;
  isSelectedFile?: boolean;
}

EmbedFrameProps interface (EmbedFrame.tsx:21-27):

interface EmbedFrameProps {
  files: PreviewFile[];
  isPlaying: boolean;
  basePath: string;
  gridOutput: boolean;
  textOutput: boolean;
}

Module Declarations

Added type declarations for third-party libraries (custom.d.ts):

  • loop-protect - Loop protection library
  • mime - MIME type detection library

Other Changes

  • Removed PropTypes runtime validation (replaced with compile-time TypeScript types)
  • Added strict typing for all function parameters and return values
  • Updated webpack config to resolve .tsx extensions

Breaking Changes

None - all changes are backward compatible.

@release-com
Copy link
Copy Markdown

release-com Bot commented May 15, 2026

Release Environments

This Environment is provided by Release, learn more!
To see the status of the Environment click on Environment Status below.

🔧Environment Status : https://app.release.com/public/Processing%20Foundation/env-fc0aec6bf9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript migration: client/modules/Preview

1 participant