You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that export default x is no longer a live binding, so it would actually be better to have export { x as default } to ensure the live binding!
This case came up considering live binding across chunking interfaces which all works out, except for default exports in this way.
Of course in scenarios where the default is a temporary variable created by Rollup, we know we can use export default as there is no live binding update in play.
Currently we output
export default xwhen we have default exports instead ofexport { x as default }.For example - https://rollupjs.org/repl?version=0.56.0&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMnZhciUyMHglMjAlM0QlMjAxMCUzQiU1Q24lNUNuZXhwb3J0JTIwZnVuY3Rpb24lMjB1cGRhdGUlMjAoKSUyMCU3QiU1Q24lNUN0eCUyMCUzRCUyMDExJTNCJTVDbiU3RCU1Q24lNUNuZXhwb3J0JTIwJTdCJTIweCUyMGFzJTIwZGVmYXVsdCUyMCU3RCUyMiU3RCU1RCUyQyUyMm9wdGlvbnMlMjIlM0ElN0IlMjJmb3JtYXQlMjIlM0ElMjJlcyUyMiUyQyUyMm5hbWUlMjIlM0ElMjJteUJ1bmRsZSUyMiUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCU3RCUyQyUyMmV4YW1wbGUlMjIlM0FudWxsJTdE
The issue is that
export default xis no longer a live binding, so it would actually be better to haveexport { x as default }to ensure the live binding!This case came up considering live binding across chunking interfaces which all works out, except for default exports in this way.
Of course in scenarios where the default is a temporary variable created by Rollup, we know we can use
export defaultas there is no live binding update in play.For example with - https://rollupjs.org/repl?version=0.56.0&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMnZhciUyMHglMjAlM0QlMjAxMCUzQiU1Q24lNUNuZXhwb3J0JTIwZnVuY3Rpb24lMjB1cGRhdGUlMjAoKSUyMCU3QiU1Q24lNUN0eCUyMCUzRCUyMDExJTNCJTVDbiU3RCU1Q24lNUNuZXhwb3J0JTIwZGVmYXVsdCUyMHglM0IlMjIlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==
Perhaps we should work on distinguishing these cases and outputting appropriately.