964 enum circular dep react native#994
Conversation
| ((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.
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.
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.