Skip to content

Commit 30b1903

Browse files
authored
Merge branch 'dev' into update-code-owners
2 parents 45b09bb + 7926f05 commit 30b1903

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
77
## Added
88

99
- [#2881](https://github.com/plotly/dash/pull/2881) Add outputs_list to window.dash_clientside.callback_context. Fixes [#2877](https://github.com/plotly/dash/issues/2877).
10+
- [#2936](https://github.com/plotly/dash/pull/2936) Adds support for TypeScript 5.5+.
1011

1112
## Fixed
1213

@@ -16,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1617
- [#2900](https://github.com/plotly/dash/pull/2900) Allow strings in layout list. Fixes [#2890](https://github.com/plotly/dash/issues/2890)
1718
- [#2908](https://github.com/plotly/dash/pull/2908) Fix when environment variables are ignored by Dash.run() at runtime. Fixes [#2902](https://github.com/plotly/dash/issues/2902)
1819
- [#2915](https://github.com/plotly/dash/pull/2915) Fix 'AttributeError' when layout is a function that returns a list of components. Fixes [#2905](https://github.com/plotly/dash/issues/2905)
20+
- [#2956](https://github.com/plotly/dash/pull/2956) Add missing useEffect dependency to dcc.Loading component.
1921

2022
## [2.17.1] - 2024-06-12
2123

components/dash-core-components/src/components/Loading.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const Loading = ({
122122
}
123123
}
124124
}
125-
}, [delay_hide, delay_show, loading_state, display]);
125+
}, [delay_hide, delay_show, loading_state, display, showSpinner]);
126126

127127
const Spinner = showSpinner && getSpinner(spinnerType);
128128

dash/extract-meta.js

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const reservedPatterns = args[1]
2121
? args[1].split('|').map(part => new RegExp(part))
2222
: [];
2323

24-
let tsconfig = {};
25-
2624
function help() {
2725
console.error('usage: ');
2826
console.error(
@@ -36,24 +34,14 @@ if (!src.length) {
3634
process.exit(1);
3735
}
3836

39-
if (fs.existsSync('tsconfig.json')) {
40-
tsconfig = JSON.parse(fs.readFileSync('tsconfig.json')).compilerOptions;
41-
// Map moduleResolution to the appropriate enum.
42-
switch (tsconfig.moduleResolution) {
43-
case 'node':
44-
tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeJs;
45-
break;
46-
case 'node16':
47-
tsconfig.moduleResolution = ts.ModuleResolutionKind.Node16;
48-
break;
49-
case 'nodenext':
50-
tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext;
51-
break;
52-
case 'classic':
53-
tsconfig.moduleResolution = ts.ModuleResolutionKind.Classic;
54-
break;
55-
default:
56-
break;
37+
function getTsConfigCompilerOptions() {
38+
// Since extract-meta can be run on JavaScript sources, if trying to get the
39+
// config doesn't work, we can fall back gracefully.
40+
try {
41+
const tsconfig = ts.getParsedCommandLineOfConfigFile('tsconfig.json', { esModuleInterop: true }, ts.sys);
42+
return tsconfig?.options ?? {};
43+
} catch {
44+
return {};
5745
}
5846
}
5947

@@ -97,7 +85,7 @@ const isUnionLiteral = typeObj =>
9785

9886
function logError(error, filePath) {
9987
if (filePath) {
100-
process.stderr.write(`Error with path ${filePath}`);
88+
process.stderr.write(`Error with path ${filePath}\n`);
10189
}
10290
process.stderr.write(error + '\n');
10391
if (error instanceof Error) {
@@ -157,7 +145,7 @@ function parseJSX(filepath) {
157145
docstringWarning(doc);
158146
return doc;
159147
} catch (error) {
160-
logError(error);
148+
logError(error, filepath);
161149
}
162150
}
163151

@@ -204,7 +192,7 @@ function gatherComponents(sources, components = {}) {
204192
return components;
205193
}
206194

207-
const program = ts.createProgram(filepaths, {...tsconfig, esModuleInterop: true});
195+
const program = ts.createProgram(filepaths, getTsConfigCompilerOptions());
208196
const checker = program.getTypeChecker();
209197

210198
const coerceValue = t => {

0 commit comments

Comments
 (0)