Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add React .tsx and .jsx to supportedFileTypes in worker.ts #3021

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WilliamBlais
Copy link

Why

This change is necessary to ensure support for React .tsx and .jsx file types in the worker logic, particularly in scenarios where files like EmailWorker.tsx render React components and manage tasks like sending emails.

How

Updating the supportedFileTypes array in worker.ts to include .tsx and .jsx. This allows the worker to correctly use React files.

Copy link
Contributor

@manast manast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. It would be great to have a minimal test case to prove that the change actually work.

@WilliamBlais
Copy link
Author

@manast Added a test case.

By default, the code in worker.ts:265 appends .js to the processorFile path when the file extension is not found in supportedFileTypes.

Would it be better to throw an exception instead of appending .js when the file type is not supported? This would provide clearer feedback and prevent potential issues caused by processing unintended file.

What do you think?

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.

2 participants