-
Notifications
You must be signed in to change notification settings - Fork 933
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
Fine tune babel config #49
Comments
Just to be clear, you tried installing the beta right? The current latest version has nothing 😀 |
Oh, nevermind. I misunderstood. You definitely have the beta |
Ah yes, we need to add the transform for trailing commas in function parameter lists and calls. Would you like to do that? |
I may look at this over the weekend. I don't mind if someone else makes the PR. 👍 |
Try this - Eject from Let me know ! |
Nah, let's just add the plugin. People shouldn't have to eject to use this library 😀 |
Hmmm.... I just realized I'm pretty sure that the transform is already included... I just ran |
Tried it with node 4 too |
Which plugin are you using to minify the |
I just reproduced, sorta:
Here's the code around that spot:
Not sure what's up with it. The comma is totally fine there... |
I will look into this issue @kentcdodds. Will let you know! (any tips on using the setup locally with |
Got it working 😄 . Here you go - http://autocomplete-react.surge.sh/ Built with |
Let's see what we need to do so folks don't have to eject from CRA. We definitely shouldn't require that! 😄 |
@kentcdodds add |
Oh, you mean add babili to this project? I'd like to avoid that too. Could you identify which plugin in babili is making the impact? I'd rather not minify the |
umm... we can also yield sourcemaps with babel I think so ? |
Sorry, that wont be good enough. Let's just make it work. It really shouldn't be a problem. |
Ok! As u say but this error is really strange 🤔 |
Agreed it is strange. I'm sure there's just one plugin that babili is using that fixes the problem. If we find out which one that is then we might know what the problem is and have a better hope of fixing it. |
I'm on it 👍 |
Thanks! |
Ahn... actually I am not getting any build errors. I imported @kentcdodds how did you reproduced the errors ? because I am not getting any 😅 |
@nitin42 This should be sufficient: |
Adding the babili preset does not get rid of this error for me. My original error is different as well:
The code from 71- _this.getItemNodeFromIndex = function (index) {
72: return _this._rootNode.querySelector(`[data-autocomplete-item-index="${index}"]`);
73- }; Adding the
The code from the offending area now: 75- _this.setHighlightedIndex = function () {
76: var highlightedIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.defaultHighlightedIndex;
77-
78: _this.internalSetState({ highlightedIndex }, function () {
79: _this.maybeScrollToHighlightedElement(highlightedIndex);
80- });
81- }; I thought that might be choking on destructuring, so I added
The code, back to template literals. But whhhhhy? 13:function setStatus(status) {
14- var isSameAsLast = statuses[statuses.length - 1] === status;
15- if (isSameAsLast) {
16- statuses = [].concat(_toConsumableArray(statuses), [status]);
17- } else {
18- statuses = [status];
19- }
20- var div = getStatusDiv();
21- div.innerHTML = `${statuses.map(getStatusHtml).join('')}`;
22-} So, I don't know if any of that helps, but I don't know what to try next. If you have any ideas, I'd be happy to keep trying. |
I think I fixed it. Thank you for digging @planigan. That gave me the insight I needed! |
@kentcdodds I tried with your new |
Hmmm.... That's a surprise... |
maybe you need to specify the browser prop? https://github.com/babel/babel-preset-env#targetsbrowsers |
I tried with: {
"presets": [
["env", {
"targets": {
"browsers": ["> 1%"]
}
}],
"react"
],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
]
} Same error. |
That's really weird. 🤔 |
Why don't we try to add the stage 2 preset 🤷♂️ |
Ok, this was my bad. I apologize. After getting the error fixed in |
Oh good! I'm glad that's been sorted out. Thanks for all your help everyone! |
I tried
react-autocompletely
with a create-react-app project, and attempted to build it (i.e.npm run build
), but received this error:I believe babel config would probably need some fine tuning: https://github.com/paypal/react-autocompletely/blob/cfc1ffffe38bac9d89555998add9d5ac2024ea40/.babelrc
The text was updated successfully, but these errors were encountered: