Skip to content
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 temporary error when imports are used, support circular imports #169

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

generalmimon
Copy link
Member

Fixes #59

Fixes #159 - this is a particularly notable instance of the bug, since TypeError: DosDatetime is not a constructor is an error that initially everyone gets when they open the Web IDE in a fresh browser (this is because zip.ksy is selected by default, and it is affected by the bug since it contains an import).

See kaitai-io/kaitai_struct#1074 and kaitai-io/kaitai_struct_compiler#264 - the actual fix was done in the KSC-generated JS code, which was changed to allow interdependent format modules to be loaded (and added to the global context in the case of the Web IDE) in any order. However, this was a backwards-incompatible change, so this set of Web IDE changes just updates our code to work with the new compiler.

@generalmimon
Copy link
Member Author

generalmimon commented Feb 15, 2024

This pull request is marked as draft until kaitai-io/kaitai_struct_compiler#264 is merged and a new version of KSC is available at https://www.npmjs.com/package/kaitai-struct-compiler?activeTab=versions. Only then the exact version of kaitai-struct-compiler will be known, so I'll have to update this PR after that.

Fixes #59

Fixes #159 -
this is a particularly notable instance of the bug, since `TypeError:
DosDatetime is not a constructor` is an error that initially everyone
gets when they open the Web IDE in a fresh browser (this is because
`zip.ksy` is selected by default, and it is affected by the bug since it
contains an import).

See kaitai-io/kaitai_struct#1074 and
kaitai-io/kaitai_struct_compiler#264 - the
actual fix was done in the KSC-generated JS code, which was changed to
allow interdependent format modules to be loaded (and added to the
global context in the case of the Web IDE) in any order. However, this
was a backwards-incompatible change, so this set of Web IDE changes just
updates our code to work with the new compiler.
@generalmimon generalmimon force-pushed the fix-fresh-and-circular-imports branch from 1082485 to 12d4036 Compare February 21, 2024 15:44
@generalmimon generalmimon marked this pull request as ready for review February 21, 2024 15:47
@generalmimon generalmimon merged commit db130c9 into master Feb 21, 2024
1 check passed
@generalmimon generalmimon deleted the fix-fresh-and-circular-imports branch February 21, 2024 15:57
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.

Empty object tree and error on opening ide with zip example Problem with imports on local storage
1 participant