client/modules/Preview: migrate to TypeScript, no-verify#4117
client/modules/Preview: migrate to TypeScript, no-verify#4117NalinDalal wants to merge 13 commits into
client/modules/Preview: migrate to TypeScript, no-verify#4117Conversation
Release EnvironmentsThis Environment is provided by Release, learn more! 🔧Environment Status : https://app.release.com/public/Processing%20Foundation/env-fc0aec6bf9 |
|
@NalinDalal The PR is currently failing due to linting and Prettier errors. Could you please take a look and fix them? |
|
Hi! Thank you very much for the PR! I ran the test/linter workflow and i see there are still some typecheck errors to resolve. could you look into those? thank you! |
|
Problem: The
Fix: Changed the guard at if (/\/\/\s*noprotect/.test(jsText)) {to: if (/\/\/\s*noprotect/.test(jsText) || hasNoProtect(indexSrc)) {This restores the original behavior where |
Fixes #3828
Summary
Migrated
client/modules/Previewfrom JavaScript to TypeScript to improve type safety and developer experience.Changes
Files Converted:
Type Definitions Added
PreviewFile interface (
filesReducer.ts:6-16):EmbedFrameProps interface (EmbedFrame.tsx:21-27):
Module Declarations
Added type declarations for third-party libraries (
custom.d.ts):loop-protect- Loop protection librarymime- MIME type detection libraryOther Changes
PropTypesruntime validation (replaced with compile-time TypeScript types).tsxextensionsBreaking Changes
None - all changes are backward compatible.