-
-
Notifications
You must be signed in to change notification settings - Fork 186
Remake typia playground compiler #1598
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
Conversation
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the playground compiler to use embed-typescript
, streamlines the build process, and enhances the UI components in the playground.
- Replaced the old TypeScriptCompiler service with a new
EmbedTypeScript
-based implementation undersrc/compiler
- Updated build scripts and
rspack.config.js
to include a dedicated compiler build step and new file paths - Improved playground components: added default script constant, JSON output support, and stricter typing
Reviewed Changes
Copilot reviewed 16 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
website/src/pages/Playground.tsx | Updated compiler service import, compile/transform logic, and script defaults |
website/src/compiler/index.ts | New EmbedTypeScript -based compiler worker implementation |
website/src/components/playground/OutputViewer.tsx | Extended to accept json language, introduced IProps namespace |
website/src/components/playground/PLAYGROUND_DEFAULT_SCRIPT.ts | Added default playground script constant |
website/rspack.config.js | Adjusted entry and output paths for new compiler directory |
website/package.json | Added build:compiler script, moved TypeScript to devDeps |
Files not reviewed (1)
- website/compiler-dependencies/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
website/src/pages/Playground.tsx:270
- Move the
createCompilerService
declaration above its first usage in the component to avoid a reference error caused by the temporal dead zone ofconst
.
const createCompilerService = new Singleton(async () => {
This pull request significantly refactors the
website
directory to improve the compiler infrastructure, streamline the build process, and enhance the playground's functionality. The most notable changes include replacing the old compiler implementation with a new one based onembed-typescript
, restructuring file paths, and updating the playground's UI components.Compiler Refactor and Infrastructure Updates:
TypeScriptCompiler
implementation with a new compiler service usingembed-typescript
for enhanced modularity and maintainability. (website/src/compiler/ICompilerService.ts
,website/src/compiler/index.ts
,website/build/compiler.js
, [1] [2] [3]package.json
forcompiler-dependencies
to manage dependencies for the compiler service. (website/compiler-dependencies/package.json
, website/compiler-dependencies/package.jsonR1-R18)Build Process Improvements:
build:compiler
) and removed redundant raw data generation logic. (website/package.json
, [1] [2] [3] [4]rspack.config.js
to reflect the new file structure and output paths for the compiler. (website/rspack.config.js
, website/rspack.config.jsL2-R7)Playground Enhancements:
PLAYGROUND_DEFAULT_SCRIPT
constant to provide a default script for the playground. (website/src/components/playground/PLAYGROUND_DEFAULT_SCRIPT.ts
, website/src/components/playground/PLAYGROUND_DEFAULT_SCRIPT.tsR1-R24)OutputViewer
component to support a newjson
language option and refactored its props for better type safety. (website/src/components/playground/OutputViewer.tsx
, [1] [2]IMessage
type inConsoleViewer
to useunknown
instead ofany
for stricter type checking. (website/src/components/playground/ConsoleViewer.tsx
, website/src/components/playground/ConsoleViewer.tsxL54-R54)File Structure and Dependency Updates:
compilers
directory and related references tocompiler
for consistency. (website/.gitignore
,website/rspack.config.js
, [1] [2]embed-typescript
to the project. (website/package.json
, [1] [2]These changes collectively enhance the maintainability, performance, and user experience of the
website
project.