Closed mrm007 closed 5 months ago
This doesn't actually work.
So it works or does not? Probably the simplest way to resolve a problem is migrate this project to TypeScript, which is something I want to do every day.
it failed because of some Atlassian packages in the lockfile
Sorry, sometimes global settings has side effects
So it works or does not?
@theKashey the initial solution with concise: true
didn't work, but this one with shouldPrintComment
does.
Can we merge this, please? It's breaking some of our builds at SEEK.
Here's the diff of the build output with changes from this PR:
👋 @mrm007, sorry for being slow - work work work.
Looking for the diff, look like that's it
/*#__PURE__*/
- // nearest focus guard <--- bad guy
React.createElement("div", {
v2.9.7 released
Thank you @theKashey 🙇♂️
Fixes #273
I couldn't install dependencies locally — it failed because of some Atlassian packages in the lockfile (I solved it by removing them from the lockfile and running
yarn install
again)Some things I tried:
"generatorOpts": { "retainLines": true }
— didn't help"generatorOpts": { "minified": true }
— removes all comments, including annotations"generatorOpts": { "concise": true }
— inlines thePURE
annotation and the offending comment, but still triggers Rollup/*#__PURE__*/
annotation in front of thediv key="guard-first"
element — breaks formattingThe simplest solution is to add"generatorOpts": { "concise": true }
(reference) to the Babel config. This makes thePURE
annotation be on the same line, thus no longer triggering Rollup. Here's a snippet of the output:Details
```js var mergedRef = useMergeRefs([parentRef, setObserveNode]); return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [ /*#__PURE__*/ // nearest focus guard React.createElement("div", { key: "guard-first", "data-focus-guard": true, tabIndex: disabled ? -1 : 0, style: hiddenGuard }), // first tabbed element guard hasPositiveIndices ? /*#__PURE__*/React.createElement("div", { // etc. ```Edit: That didn't actually work. Using
shouldPrintComment
with a modified default works.