Skip to content

V2 : fix json import#675

Merged
SimonClark merged 7 commits intoV2from
v2-fix-json-import
Sep 14, 2020
Merged

V2 : fix json import#675
SimonClark merged 7 commits intoV2from
v2-fix-json-import

Conversation

@z3dev
Copy link
Copy Markdown
Member

@z3dev z3dev commented Sep 6, 2020

These changes fix issues when drag-n-drop of exported JSON files, i.e. designs saved as JSON. There were issues with the handling of single files, as well as a missing deserializer for JSON files.

UNDERNEATH... I've been wanting to refactor how the deserializers were registered in the IO module. The following changes have been made:

  • create a list of deserializers by extention (new deserializers.js file)
  • correct the index of IO module to include the deserializers
  • change core transformSources to use the list of deserializers, simplify redundant verbose code
  • change core registerExtensions to use the list of deserializers, simplify redundant verbose code
  • change cli generateOutputData to use the list of deserializers

Now, there's just one list which can change, adding or removing a deserializer for an external format.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Does your submission pass tests?

@z3dev z3dev requested a review from SimonClark September 13, 2020 23:43

/* function to turn old style jscad code with implicit imports
into code with explicit exports/imports */
// FIXME wouldn't a javascript error be better then 'hacking' the users code?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! And if there is a time to do this, it's now.

Copy link
Copy Markdown
Contributor

@SimonClark SimonClark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@SimonClark SimonClark merged commit 05caf60 into V2 Sep 14, 2020
@z3dev z3dev deleted the v2-fix-json-import branch September 15, 2020 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants