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] Require logic is faulty for compiled apps #40

Merged
merged 2 commits into from
Oct 6, 2021

Conversation

d-gubert
Copy link
Member

@d-gubert d-gubert commented Oct 5, 2021

The logic used to require modules after the app is compiled was wrong, considering only the result from evaluating the last line from the required script.

We needed to handle this case due to backward compatibility since the main class file might export a class with an unknown name, which was supported in the early versions of the Apps-Engine.

This PR fixes the problem by returning the previous result ONLY IF we find that the required file exports ONLY ONE property, which is what happens in the case of the main class file; otherwise, we return the full exports object.

@d-gubert d-gubert requested a review from thassiov October 5, 2021 23:35
Copy link
Contributor

@thassiov thassiov left a comment

Choose a reason for hiding this comment

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

LGTM

@thassiov thassiov merged commit ffc0ed6 into master Oct 6, 2021
@thassiov thassiov deleted the fix/compiled-require-breaking branch October 6, 2021 13:02
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.

None yet

2 participants