Unexpected behaviour on import with dynamicTyping
See original GitHub issueSorry to disturb you again, but I’ve found this:
If you change your example posts.js
to:
const ListActions = (props) => {
const {
className,
basePath,
total,
resource,
currentSort,
filterValues,
exporter,
} = props;
const config = {
logging: true,
validateRow: async (row) => {
if (row.id) {
// throw new Error("AAAA");
}
},
};
return (
<TopToolbar className={className}>
<CreateButton basePath={basePath} />
<ExportButton
disabled={total === 0}
resource={resource}
sort={currentSort}
filter={filterValues}
exporter={exporter}
/>
<ImportButton {...props} {...config} parseConfig={{dynamicTyping: true}}/>
</TopToolbar>
);
};
i.e. delete postCommitCallback and add this parseConfig, when you import data with conflicting ids, it will not show the dialog but quit directly. Is it an expected behaviour? Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Module Federation Dynamic Import · Issue #11869 - GitHub
If the current behavior is a bug, please provide the steps to reproduce. I have 2 apps : shell : manager, head of...
Read more >The Unreasonable Effectiveness of Dynamic Typing for ...
I disagree, I warmed to dynamic typing specifically due to the experience of working with 2-3 million lines of C++ code. The problem...
Read more >Don't dynamically import code in a directory - ITNEXT
The behavior is unexpected. Not all developers may be aware of the import trick, especially since it's usually limited to certain directories, ...
Read more >ES2020: `import()` – dynamically importing ES modules - 2ality
First, this import declaration can only appear at the top level of a module. That prevents you from importing modules inside an if...
Read more >What functionality does dynamic typing allow? [closed]
Most of dynamic typing languages have mechanisms to provide a generic behavior that will catch any message that is passed to their interface....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems to me it is best to send whatever the user give you, i.e. the parse result from csv, so that the user can have full control. That being said, in the definition of
Identifier
isstring | number
, so you can send string. Just mark it in theREADME
if you always send a string in case they putidentifier as number
somewhere in code.I do expect the type in the parse result corresponding to the type from the DataProvider, which is both number in your case. If the type is different but the value is the same, I think it could be safe to say it’s just a type issue: there’s hardly anyone uses two types to define a single table column.
Hey @peter-jerry-ye, I’ve just merged it in.
Have a test and let me know if there’s any issues.
Also, what dataprovider are you using in your project? just curious