Skip to content

Commit

Permalink
Build: enable JSX support (#27176)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamvinogradov authored Apr 16, 2024
1 parent 61051a4 commit 0c31954
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/devextreme/build/gulp/transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const esmTranspileSrc = src.concat([
'!**/*.json'
]);

const srcTsPattern = 'js/__internal/**/*.ts';
const srcTsPattern = 'js/__internal/**/*.{ts,tsx}';
const srcTsIgnorePatterns = [
'**/__tests__/**/*'
];
Expand All @@ -66,7 +66,7 @@ const generatedTs = [
const bundlesSrc = ['js/bundles/**/*.js'];

const TS_OUTPUT_BASE_DIR = 'artifacts/dist_ts';
const TS_OUTPUT_SRC = [`${TS_OUTPUT_BASE_DIR}/__internal/**/*.js`];
const TS_OUTPUT_SRC = [`${TS_OUTPUT_BASE_DIR}/__internal/**/*.{js,jsx}`];
const TS_COMPILER_CONFIG = {
baseAbsPath: path.resolve(__dirname, '../..'),
relativePath: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { BaseInfernoComponent } from '@devextreme/runtime/inferno';
import type { PropsWithChildren, PropsWithClassName } from '@ts/core/r1/index';
import type { VNode } from 'inferno';
import { createVNode } from 'inferno';

import { renderUtils } from '../../utils/index';
import type { ContentTemplateProps } from '../types';
Expand Down Expand Up @@ -36,7 +34,7 @@ export const CellBaseDefaultProps: CellBaseProps = {
},
};
export class CellBase extends BaseInfernoComponent<CellBaseProps> {
render(): VNode {
render(): JSX.Element {
const {
className,
isFirstGroupCell,
Expand All @@ -45,12 +43,17 @@ export class CellBase extends BaseInfernoComponent<CellBaseProps> {
ariaLabel,
} = this.props;

const classNames = renderUtils
const classes = renderUtils
.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, className);

return createVNode(1, 'td', classNames, children, 0, {
'aria-label': ariaLabel,
});
return (
<td
className={classes}
aria-label={ariaLabel}
>
{children}
</td>
);
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/__internal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"outDir": "../../artifacts/dist_ts",
"module": "es6",
"target": "ES2017",
"jsx": "preserve",
"baseUrl": "../",
"skipLibCheck": true,
"allowJs": true,
Expand Down

0 comments on commit 0c31954

Please sign in to comment.