Skip to content

Commit

Permalink
Trying to solve tsx bug with no luck.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Apr 26, 2022
1 parent 888a54d commit 30f2336
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 4 deletions.
4 changes: 3 additions & 1 deletion tests/tsx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ RUN cd / \

COPY tests/tsx/test.tsx /scripts/
COPY tests/tsx/tsconfig.json /scripts/
COPY tests/tsx/package.json /scripts/
COPY tests/tsx/package-lock.json /scripts/

# Needed in order to load the tsconfig.json
WORKDIR /scripts/
Expand All @@ -43,7 +45,7 @@ ARG CACHE_INVALIDATE

RUN echo "Running tests ${CACHE_INVALIDATE}" \
&& export PATH="/gnu/bin:${PATH}" \
&& npm install metacall react react-dom
&& npm install

RUN export LOADER_SCRIPT_PATH="/scripts/" \
&& export METACALL_PATH="/gnu/store/`ls /gnu/store/ | grep metacall | head -n 1`" \
Expand Down
120 changes: 120 additions & 0 deletions tests/tsx/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/tsx/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "templating-tsx",
"version": "1.0.0",
"main": "templating.tsx",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"license": "Apache-2.0",
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
2 changes: 1 addition & 1 deletion tests/tsx/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import React from 'react';
import { renderToString } from 'react-dom/server';

export function hello(text: string): string {
return renderToString(<h1>Hello ${text}</h1>);
return renderToString(<h1>{`Hello ${text}`}</h1>);
}
6 changes: 4 additions & 2 deletions tests/tsx/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"templating.tsx"
],
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"esModuleInterop": true,
"jsx": "react",
"lib": ["es2015", "dom"]
"lib": ["es2016", "dom"]
}
}

0 comments on commit 30f2336

Please sign in to comment.