diff --git a/examples/.gitignore b/examples/.gitignore index d8b83df9c..f254ebc8f 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1 +1,2 @@ package-lock.json +react-replay-webpack4/dist/ diff --git a/examples/react-replay-webpack4/README.md b/examples/react-replay-webpack4/README.md index eb2846492..256f2e83e 100644 --- a/examples/react-replay-webpack4/README.md +++ b/examples/react-replay-webpack4/README.md @@ -17,25 +17,15 @@ Run `npm run build` to build the project. The build artifacts will be stored in Run `npm run start` to launch index.html in a browser. -## Preparing for rollbar.js tests - -(For rollbar.js maintainers) - -Rollbar.js test automation includes tests that load and exercise this example app. -For those tests to work, main.js must be available and up to date in ./examples/webpack/dist/. -If the example app has changed or changes to rollbar.js need to be pulled in, -update and commit a new main.js. - -``` -# Build the rollbar.js dist if needed. -npm run build - -# Prepare the example's npm bundle. -cd examples/react && npm install - -# Build the output files. -npm run build - -# The rollbar.js dist is no longer needed, and can be reverted. -cd ../.. && git checkout dist -``` +## For rollbar.js maintainers + +`dist/` is not committed. CI's `npm run validate:examples` installs and builds +this example against the current SDK, which checks that webpack 4 still resolves +`rollbar/replay` through `replay/package.json`. + +The production build uses an absolute `publicPath`, +`/examples/react-replay-webpack4/dist/`, because `loadHtml` in +`test/util/fixtures.ts` recreates a page's scripts inside the test runner's +page, where a relative path would resolve against the wrong URL. Because `dist/` +is not committed, a browser test that loads this build would also need CI to +build the example before the browser tests run. diff --git a/examples/react-replay-webpack4/dist/index.html b/examples/react-replay-webpack4/dist/index.html deleted file mode 100644 index 2659846bf..000000000 --- a/examples/react-replay-webpack4/dist/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - React Example - - -
- - diff --git a/examples/react-replay-webpack4/dist/main.js b/examples/react-replay-webpack4/dist/main.js deleted file mode 100644 index 668293ade..000000000 --- a/examples/react-replay-webpack4/dist/main.js +++ /dev/null @@ -1,31 +0,0 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/examples/react/dist/",n(n.s=2)}([function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=a(e),s=1;sR.length&&R.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case i:case a:u=!0}}if(u)return r(o,t,""===n?"."+F(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;sthis.eventPool.length&&this.eventPool.push(e)}function fe(e){e.eventPool=[],e.getPooled=se,e.release=ce}o(ue.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:le,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=le,this._dispatchInstances=this._dispatchListeners=null}}),ue.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ue.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return o(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,fe(n),n},fe(ue);var de=ue.extend({data:null}),pe=ue.extend({data:null}),he=[9,13,27,32],me=V&&"CompositionEvent"in window,ve=null;V&&"documentMode"in document&&(ve=document.documentMode);var ye=V&&"TextEvent"in window&&!ve,ge=V&&(!me||ve&&8=ve),be=String.fromCharCode(32),we={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},ke=!1;function xe(e,t){switch(e){case"keyup":return-1!==he.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function _e(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Te=!1;var Ee={eventTypes:we,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(me)e:{switch(e){case"compositionstart":o=we.compositionStart;break e;case"compositionend":o=we.compositionEnd;break e;case"compositionupdate":o=we.compositionUpdate;break e}o=void 0}else Te?xe(e,n)&&(o=we.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=we.compositionStart);return o?(ge&&"ko"!==n.locale&&(Te||o!==we.compositionStart?o===we.compositionEnd&&Te&&(i=ie()):(re="value"in(ne=r)?ne.value:ne.textContent,Te=!0)),o=de.getPooled(o,t,n,r),i?o.data=i:null!==(i=_e(n))&&(o.data=i),B(o),i=o):i=null,(e=ye?function(e,t){switch(e){case"compositionend":return _e(t);case"keypress":return 32!==t.which?null:(ke=!0,be);case"textInput":return(e=t.data)===be&&ke?null:e;default:return null}}(e,n):function(e,t){if(Te)return"compositionend"===e||!me&&xe(e,t)?(e=ie(),oe=re=ne=null,Te=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1