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
While upgrading to Embroider in our main app, I noticed that the babel plugin for @embroider/macros transpiles code like aKnownValue?.foo to undefined prematurely.
We have several places in our codebase where this optional chaining is applied, and it's currently blocking us from upgrading to Embroider since it seems like Embroider makes this babel plugin run on all the source code while it didn't before.
I tried to pinpoint why this was happening but it seems like this is currently happening by design, as I noticed there's a test that makes sure this works:
If anyone could help me give some pointers as what exactly needs to happen, I can look into creating a PR, but I'm not really sure where this issue should be fixed.
Thanks for working on this project!
The text was updated successfully, but these errors were encountered:
Summary
While upgrading to Embroider in our main app, I noticed that the babel plugin for
@embroider/macros
transpiles code likeaKnownValue?.foo
toundefined
prematurely.Steps to reproduce
I created a repo here which showcases the issue: https://github.com/ArnaudWeyts/embroider-macros-reproduction
What happens is the following:
gets transpiled into
We have several places in our codebase where this optional chaining is applied, and it's currently blocking us from upgrading to Embroider since it seems like Embroider makes this babel plugin run on all the source code while it didn't before.
I tried to pinpoint why this was happening but it seems like this is currently happening by design, as I noticed there's a test that makes sure this works:
embroider/packages/macros/tests/babel/eval.test.ts
Lines 35 to 38 in e55b055
Other pointers that I discovered:
embroider/packages/macros/src/babel/macros-babel-plugin.ts
Line 250 in acb8c6f
embroider/packages/macros/src/babel/evaluate-json.ts
Lines 156 to 169 in f41229b
If anyone could help me give some pointers as what exactly needs to happen, I can look into creating a PR, but I'm not really sure where this issue should be fixed.
Thanks for working on this project!
The text was updated successfully, but these errors were encountered: