Comments (10)
@bwindels thanks, I will check it asap.
from rollup-plugin-cleanup.
Same issue here!
I was able to narrow it down to this line in skip-regex.js. For context the stacktrace is included.
R_JS_REGEX:
"^/(?=[^*\/])[^[/\](?:(?:\.|[(?:\.|[^\]\\])])[^[\/])?/[gimuys]"
match[0]
"/element.height;var pathData=pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH',{xScaleFactor:1,yScaleFactor:1,containerWidth:element.width,containerHeight:element.height,position:{mx:0.451,my:yPosition}});drawPath(parentGfx,pathData,{strokeWidth:2});}this._drawPath=drawPath;}inherits(BpmnRenderer,BaseRenderer);BpmnRenderer.$inject=['config.bpmnRenderer','eventBus','styles','pathMap','canvas','textRenderer'];BpmnRenderer.prototype.canRender=function(element){return is(element,'bpmn:BaseElement');};BpmnRenderer.prototype.drawShape=function(parentGfx,element){var type=element.type;var h=this.handlers[type];return h(parentGfx,element);};BpmnRenderer.prototype.drawConnection=function(parentGfx,element){var type=element.type;var h=this.handlers[type];return h(parentGfx,element);};BpmnRenderer.prototype.getShapePath=function(element){if(is(element,'bpmn:Event')){return getCirclePath(element);}if(is(element,'bpmn:Activity')){return getRoundRectPath(element,TASK_BORDER_RADIUS);}if(is(element,'bpmn:Gateway')){return getDiamondPath(element);}return getRectPath(element);};"
from rollup-plugin-cleanup.
@Aqours I will check it asap. Thanks.
from rollup-plugin-cleanup.
@aMarCruz were you able to look into this? I bumped into this issue today as well.
from rollup-plugin-cleanup.
I'll look at this issue until this week-end.
from rollup-plugin-cleanup.
I think I am encountering the same issue, rollup hangs forever with this plugin enabled on this particular statement. Removing the statement, or this plugin from my rollup config makes rollup not hang anymore. Let me know if I can provide any further details.
I tried reproducing the problem by passing the same code through js-cleanup but wasn't able to reproduce that way.
from rollup-plugin-cleanup.
@Aqours, @gevalo1, @xania, @bwindels , please try cleanup v3.2.1, it is already in npm.
from rollup-plugin-cleanup.
@Aqours, @gevalo1, @xania, @bwindels , please try cleanup v3.2.1, it is already in npm.
Still hangs for me with cat node_modules/rollup-plugin-cleanup/package.json | jq ".version"
:
"3.2.1"
from rollup-plugin-cleanup.
Same issue here!
I was able to narrow it down to this line in skip-regex.js. For context the stacktrace is included.R_JS_REGEX:
"^/(?=[^_/])[^[/](?:(?:.|[(?:.|[^]])])[^[/])_?/[gimuys]*"
match[0]
"/element.height;var pathData=pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH',{xScaleFactor:1,yScaleFactor:1,containerWidth:element.width,containerHeight:element.height,position:{mx:0.451,my:yPosition}});drawPath(parentGfx,pathData,{strokeWidth:2});}this._drawPath=drawPath;}inherits(BpmnRenderer,BaseRenderer);BpmnRenderer.$inject=['config.bpmnRenderer','eventBus','styles','pathMap','canvas','textRenderer'];BpmnRenderer.prototype.canRender=function(element){return is(element,'bpmn:BaseElement');};BpmnRenderer.prototype.drawShape=function(parentGfx,element){var type=element.type;var h=this.handlers[type];return h(parentGfx,element);};BpmnRenderer.prototype.drawConnection=function(parentGfx,element){var type=element.type;var h=this.handlers[type];return h(parentGfx,element);};BpmnRenderer.prototype.getShapePath=function(element){if(is(element,'bpmn:Event')){return getCirclePath(element);}if(is(element,'bpmn:Activity')){return getRoundRectPath(element,TASK_BORDER_RADIUS);}if(is(element,'bpmn:Gateway')){return getDiamondPath(element);}return getRectPath(element);};"
Confirmed, i'm running into the same issue! This might be a problem for a lot of people because this fails to cleanup Google Web Vitals distribution (node_modules/web-vitals/dist/web-vitals.es5.min.js)
Regex used by skip-regex
/^\/(?=[^*/])[^[/\\]*(?:(?:\\.|\[(?:\\.|[^\]\\]*)*\])[^[\\/]*)*?\/[gimuys]*/
String that kills it
/0,c((function(n){var e=n.timeStamp;return t=e}),!0)),{get timeStamp(){return t}}},v=function(t){var n,e=i("FCP"),r=d(),o=a("paint",(function(t){"first-contentful-paint"===t.name&&t.startTime<r.timeStamp&&(e.value=t.startTime,e.isFinal=!0,e.entries.push(t),n())}));o&&(n=l(t,e,o))},f=function(t){var n=i("FID"),e=d(),r=function(t){t.startTime<e.timeStamp&&(n.value=t.processingStart-t.startTime,n.entries.push(t),n.isFinal=!0,s())},o=a("first-input",r),s=l(t,n,o);o?c((function(){o.takeRecords().map(r),o.disconnect()}),!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay((function(t,i){i.timeStamp<e.timeStamp&&(n.value=t,n.isFinal=!0,n.entries=[{entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+t}],s())}))},m=function(){return n||(n=new Promise((function(t){return["scroll","keydown","pointerdown"].map((function(n){addEventListener(n,t,{once:!0,passive:!0,capture:!0})}))}))),n},g=function(t){var n,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i("LCP"),o=d(),s=function(t){var e=t.startTime;e<o.timeStamp?(r.value=e,r.entries.push(t)):r.isFinal=!0,n()},u=a("largest-contentful-paint",s);if(u){n=l(t,r,u,e);var p=function(){r.isFinal||(u.takeRecords().map(s),r.isFinal=!0,n())};m().then(p),c(p,!0)}},h=function(t){var n,e=i("TTFB");n=function(){try{var n=performance.getEntriesByType("navigation")[0]||function(){var t=performance.timing,n={entryType:"navigation",startTime:0};for(var e in t)"navigationStart"!==e&&"toJSON"!==e&&(n[e]=Math.max(t[e]-t.navigationStart,0));return n}();e.value=e.delta=n.responseStart,e.entries=[n],e.isFinal=!0,t(e)}catch(t){}},"complete"===document.readyState?setTimeout(n,0):addEventListener("pageshow",n)};export{p as getCLS,v as getFCP,f as getFID,g as getLCP,h as getTTFB};
@aMarCruz I tried using a different regex found on stackoverflow - it solves the performance problem and works fine for my code, however it fails 6 of your test cases. Do you think this performance issue could be resolved any time soon?
from rollup-plugin-cleanup.
I can also confirm that the issue is with using this with web-vitals package
from rollup-plugin-cleanup.
Related Issues (20)
- Errors out on spread operator HOT 5
- Pass more options to acorn parser HOT 6
- Not cleaning up properly /**/ comments HOT 3
- Using Acorn plugins doesn't work as specified by README HOT 5
- comments: 'none' not removing all comments HOT 3
- Version 3.1.0 fails for certain template literals HOT 2
- Is this plugin still maintained? HOT 2
- when i use comments: 'none', but comments still removed HOT 2
- Does not remove comments generated by Babel
- Oddly formatted Turf.js jsDoc comments not removed HOT 2
- Using hooks as filters
- 'lineEndings: "mac"' disrupts generated sourcemap
- Doesn't work for d.ts files
- Options typing
- Maintain comments starting with /*! HOT 5
- Rollup.js: cleanup didn't generate a sourcemap for the transformation HOT 2
- Empty line after deleting comment HOT 5
- blank lines within template literals are erroneously removed HOT 2
- feature request: removing arbitrary chunks of code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rollup-plugin-cleanup.