-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 1365: support binary deserializers in CLI #1366
Fix issue 1365: support binary deserializers in CLI #1366
Conversation
CLI loads required files as binary (arraybuffer) Tests
@eldanb Oh! You provided the changes. Nice! The changes are fine except for one point. Each deserializer has a specific API, and changing those now in V2 is probably not a good idea. There are other applications using those deserializers. :( I suggest doing something like the core library does, and choose the buffer contents based on file extension.
Also, there are some new formats coming in V3, including 3MF. So, maybe the IO library needs another list, or extend the list of 'formats'. Then there's one place that keeps track of the required 'binary' versus 'string' contents. |
But I didn't change the serializers' APIs. To be clear -- anything that worked with the deserializers prior to my change would continue working with them. |
Looking at binaryMimeTypes like this means that there are multiple places that encode the deserializer's expected API, which I recommend to avoid. If you prefer we can decide that a deserializer function carries a "isBinary" property, and based on that we either load binary or text. But that too is more cumbersome, I believe, than simply declaring the deserializer's API (as it is now) as receiving "string or ArrayBuffer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldanb a few questions and suggestions.
@z3dev I've committed changes per your comments. |
Yeah. The version updates happen automatically via Lerna. I'll double check. |
@platypii please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine, and I appreciate the tests.
However I have to admit I was unable to re-pro the issue? I downloaded example_project.zip from your issue #1365. But when I use the latest published cli, I don't get an error? Maybe I'm missing something?
(update: nevermind I see that I needed to run it on the whole folder to get the error)
To reproduce the issue you should require() the stl. There's a sample project there which I've added to the tests. Running the CLI on it fails. also the tests I added for back-loading projects fail without the fix. |
Confirmed I was able to reproduce the failure on master, but success on this pr branch 👍 |
@eldanb these changes are all set to go. fyi, there are coding style standards. But there are probably lots of exceptions in V2.
i will roll a release this weekend. |
All Submissions:
Thank you for your help in advance, much appreciated !