-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
964 enum circular dep react native #994
964 enum circular dep react native #994
Conversation
src/enum.js
Outdated
@@ -5,7 +5,7 @@ module.exports = Enum; | |||
var ReflectionObject = require("./object"); | |||
((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; | |||
|
|||
var Namespace = require("./namespace"), | |||
var getNamespace = function () { return require("./namespace") }, |
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.
Isn't there another way, like reordering imports? Asking because there's already a more general workaround in place for similar cases that doesn't require calling a function each time, and instead sets these things up on instantiation.
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.
I see, neat! Updated it :)
Ps. had some fun with node --max_inlined_bytecode_size=0 test.js
, not sure if the extra function call would have mattered in execution, though using existing logic is preferred!
Change looks good, hope this can be merged into master soon. |
Thanks! :) |
Could you check that master, with my additional commit, is working as intended with React Native? |
@dcodeIO the latest version on npmjs is still 6.8.6, when can we expect 6.8.7 with this fix to be published? Thanks. |
Thanks for the reminder. I had to do some significant changes to dependencies and the build step in the last two commits. Can you verify that master is working for you? |
I can confirm that master is in a good state for us (@SlyryD and I are on the same team). |
React native default setup is unable to handle the circular dependency. Delaying the use solves this (7 char change, but changed to legacy function style to match code style).
See #964.