Minimize HTTP requests
See original GitHub issueHi, and thanks for sharing this module, it’s really helpful.
I have a concern with the way you send the imported records to the backend (using a list of create
calls). This is not efficient from a network point of view, and can even be seen as a DoS from the backend.
May I suggest you call a new verb on the dataProvider (something like createMany
), and leave the implementation to the developers? That way, if their API allows a single call to create many records, they can optimize the call.
I also have a concern about the create / update choice un the UI. In my opinion, the button should be smarter, and detect the records that are already present (using a getMany), then update those and create the remaining ones. The option in the dialog should disappear, and only be shown if necessary (just like the file copy dialog in your system asks for a confirmation to ignore, update, or stop in that case).
Finally, I suggest that clicking on the “import” button opens the file selector right away. The file format (csv/tsv) can be enforced by a type attribute in the file input, and the presence of an id column can be checked a posteriori.
These limitations are kind of blockers for me. Is there a chance that you implement these in your module, or should I redevelop another module on my side?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top GitHub Comments
Hi @fzaninotto, @Odonno, We finally have a working alpha release of the new import workflow, let me know what you think!
Try live demo here: https://benwinding.github.io/react-admin-import-csv/#/posts
Try out
alpha-release
package herenpm install react-admin-import-csv/v/1.0.0-alpha.0
All changes are in PR: #27
I’m talking about the file transfer dialog (here, in Windows)