diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index 10775f2d37b5..bb44a3aa5654 100644 --- a/src/Components/Web.JS/dist/Release/blazor.server.js +++ b/src/Components/Web.JS/dist/Release/blazor.server.js @@ -16,4 +16,4 @@ var r=n(54),o=n(55),i=n(56);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647 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,s,c=a(e),u=1;u0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(10),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(68),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(8))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){d(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=s},function(e,t,n){(t=e.exports=n(40)).Stream=t,t.Readable=t,t.Writable=n(45),t.Duplex=n(9),t.Transform=n(46),t.PassThrough=n(72)},function(e,t,n){"use strict";e.exports=i;var r=n(46),o=n(19);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(15),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(23);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(39).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var a=e.readUInt32BE(t+0),s=e.readUInt32BE(t+4);return(4294967296*a+s)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),a(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),a(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),s(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&h))return a(e,r,i=15&h,1);if(128==(240&h))return s(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function a(e,t,r,o){var a,s=[],c=0;for(t+=o,a=0;a.1)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,a){function s(c,u){var l,f,h;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce((function(e,t){return e.append(s(t,!0)),e}),o().append(l));else{if(!a&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var s=4*a,c=i/Math.pow(2,32),u=s+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,a,s=[];for(n=0;n>8),s.push(255&a)):(s.push(201),s.push(a>>24),s.push(a>>16&255),s.push(a>>8&255),s.push(255&a));return o().append(r.from(s)).append(i)}(c)||function(e){var t,n,i=[],a=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++a,i.push(s(t,!0)),i.push(s(e[t],!0)));a<16?(n=r.allocUnsafe(1))[0]=128|a:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1));return i.unshift(n),i.reduce((function(e,t){return e.append(t)}),o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return i(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return i(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return i(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var a=1,s=t+7;s>=t;s--){var c=(255^e[s])+a;e[s]=255&c,a=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return s}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]this.nextBatchId?this.fatalError?(this.logger.log(s.LogLevel.Debug,"Received a new batch "+e+" but errored out on a previous batch "+(this.nextBatchId-1)),[4,n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())]):[3,4]:[3,5];case 3:return o.sent(),[2];case 4:return this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed."),[2];case 5:return o.trys.push([5,7,,8]),this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),[4,this.completeBatch(n,e)];case 6:return o.sent(),[3,8];case 7:throw r=o.sent(),this.fatalError=r.toString(),this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,r.toString()),r;case 8:return[2]}}))}))},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(s.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}}))}))},e}();t.RenderQueue=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77),o=n(78),i=function(){function e(e){this.batchData=e;var t=new u(e);this.arrayRangeReader=new l(e),this.arrayBuilderSegmentReader=new f(e),this.diffReader=new a(e),this.editReader=new s(e,t),this.frameReader=new c(e,t)}return e.prototype.updatedComponents=function(){return o.readInt32LE(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return o.readInt32LE(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+20*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+8*t;return o.readUint64LE(this.batchData,n)},e}();t.OutOfProcessRenderBatch=i;var a=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),s=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),c=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return o.readUint64LE(this.batchDataUint8,e+12)},e}(),u=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=o.readInt32LE(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t=o.readInt32LE(this.batchDataUint8,this.stringTableStartIndex+4*e),n=o.readLEB128(this.batchDataUint8,t),i=t+o.numLEB128Bytes(n),a=new Uint8Array(this.batchDataUint8.buffer,this.batchDataUint8.byteOffset+i,n);return r.decodeUtf8(a)},e}(),l=function(){function e(e){this.batchDataUint8=e}return e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}(),f=function(){function e(e){this.batchDataUint8=e}return e.prototype.offset=function(e){return 0},e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof TextDecoder?new TextDecoder("utf-8"):null;t.decodeUtf8=r?r.decode.bind(r):function(e){var t=0,n=e.length,r=[],o=[];for(;t65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Math.pow(2,32),o=Math.pow(2,21)-1;function i(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}t.readInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},t.readUint32LE=i,t.readUint64LE=function(e,t){var n=i(e,t+4);if(n>o)throw new Error("Cannot read uint64 with high order part "+n+", because the result would exceed Number.MAX_SAFE_INTEGER.");return n*r+i(e,t)},t.readLEB128=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.MaximumFirstRetryInterval?e.MaximumFirstRetryInterval:t.retryIntervalMilliseconds,[4,this.delay(r)]):[3,7];case 2:if(o.sent(),this.isDisposed)return[3,7];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,this.reconnectCallback()];case 4:return o.sent()||this.reconnectDisplay.rejected(),[2];case 5:return i=o.sent(),this.logger.log(s.LogLevel.Error,i),[3,6];case 6:return n++,[3,1];case 7:return this.reconnectDisplay.failed(),[2]}}))}))},e.prototype.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e.MaximumFirstRetryInterval=3e3,e}()},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.getLoader=function(){var e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e},e}();t.DefaultReconnectDisplay=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,n,r){this.dialog=t,this.maxRetries=n,this.document=r,this.document=r;var o=this.document.getElementById(e.MaxRetriesId);o&&(o.innerText=this.maxRetries.toString())}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.update=function(t){var n=this.document.getElementById(e.CurrentAttemptId);n&&(n.innerText=t.toString())},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e.MaxRetriesId="components-reconnect-max-retries",e.CurrentAttemptId="components-reconnect-current-attempt",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return l})),n.d(t,"MessagePackHubProtocol",(function(){return u}));var r=n(10),o=n(11),i=n(2),a=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t},e}();var s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=3?e[2]:void 0,error:e[1],type:i.MessageType.Close}},e.prototype.createPingMessage=function(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:i.MessageType.Ping}},e.prototype.createInvocationMessage=function(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");var n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:i.MessageType.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:i.MessageType.Invocation}},e.prototype.createStreamItemMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:i.MessageType.StreamItem}},e.prototype.createCompletionMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");var n,r,o=t[3];if(o!==this.voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");switch(o){case this.errorResult:n=t[4];break;case this.nonVoidResult:r=t[4]}return{error:n,headers:e,invocationId:t[2],result:r,type:i.MessageType.Completion}},e.prototype.writeInvocation=function(e){var t,n=o(this.messagePackOptions);return t=e.streamIds?n.encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):n.encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),a.write(t.slice())},e.prototype.writeStreamInvocation=function(e){var t,n=o(this.messagePackOptions);return t=e.streamIds?n.encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):n.encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),a.write(t.slice())},e.prototype.writeStreamItem=function(e){var t=o(this.messagePackOptions).encode([i.MessageType.StreamItem,e.headers||{},e.invocationId,e.item]);return a.write(t.slice())},e.prototype.writeCompletion=function(e){var t,n=o(this.messagePackOptions),r=e.error?this.errorResult:e.result?this.nonVoidResult:this.voidResult;switch(r){case this.errorResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r,e.error]);break;case this.voidResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r]);break;case this.nonVoidResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r,e.result])}return a.write(t.slice())},e.prototype.writeCancelInvocation=function(e){var t=o(this.messagePackOptions).encode([i.MessageType.CancelInvocation,e.headers||{},e.invocationId]);return a.write(t.slice())},e.prototype.readHeaders=function(e){var t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t},e}(),l="6.0.0-dev"}]); \ No newline at end of file +*/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,s,c=a(e),u=1;u0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(10),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(68),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(8))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){d(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=s},function(e,t,n){(t=e.exports=n(40)).Stream=t,t.Readable=t,t.Writable=n(45),t.Duplex=n(9),t.Transform=n(46),t.PassThrough=n(72)},function(e,t,n){"use strict";e.exports=i;var r=n(46),o=n(19);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(15),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(23);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(39).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var a=e.readUInt32BE(t+0),s=e.readUInt32BE(t+4);return(4294967296*a+s)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),a(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),a(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),s(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&h))return a(e,r,i=15&h,1);if(128==(240&h))return s(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function a(e,t,r,o){var a,s=[],c=0;for(t+=o,a=0;a.1)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,a){function s(c,u){var l,f,h;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce((function(e,t){return e.append(s(t,!0)),e}),o().append(l));else{if(!a&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var s=4*a,c=i/Math.pow(2,32),u=s+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,a,s=[];for(n=0;n>8),s.push(255&a)):(s.push(201),s.push(a>>24),s.push(a>>16&255),s.push(a>>8&255),s.push(255&a));return o().append(r.from(s)).append(i)}(c)||function(e){var t,n,i=[],a=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++a,i.push(s(t,!0)),i.push(s(e[t],!0)));a<16?(n=r.allocUnsafe(1))[0]=128|a:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1));return i.unshift(n),i.reduce((function(e,t){return e.append(t)}),o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return i(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return i(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return i(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var a=1,s=t+7;s>=t;s--){var c=(255^e[s])+a;e[s]=255&c,a=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return s}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]this.nextBatchId?this.fatalError?(this.logger.log(s.LogLevel.Debug,"Received a new batch "+e+" but errored out on a previous batch "+(this.nextBatchId-1)),[4,n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())]):[3,4]:[3,5];case 3:return o.sent(),[2];case 4:return this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed."),[2];case 5:return o.trys.push([5,7,,8]),this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),[4,this.completeBatch(n,e)];case 6:return o.sent(),[3,8];case 7:throw r=o.sent(),this.fatalError=r.toString(),this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,r.toString()),r;case 8:return[2]}}))}))},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(s.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}}))}))},e}();t.RenderQueue=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77),o=n(78),i=function(){function e(e){this.batchData=e;var t=new u(e);this.arrayRangeReader=new l(e),this.arrayBuilderSegmentReader=new f(e),this.diffReader=new a(e),this.editReader=new s(e,t),this.frameReader=new c(e,t)}return e.prototype.updatedComponents=function(){return o.readInt32LE(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return o.readInt32LE(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+20*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+8*t;return o.readUint64LE(this.batchData,n)},e}();t.OutOfProcessRenderBatch=i;var a=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),s=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),c=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return o.readUint64LE(this.batchDataUint8,e+12)},e}(),u=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=o.readInt32LE(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t=o.readInt32LE(this.batchDataUint8,this.stringTableStartIndex+4*e),n=o.readLEB128(this.batchDataUint8,t),i=t+o.numLEB128Bytes(n),a=new Uint8Array(this.batchDataUint8.buffer,this.batchDataUint8.byteOffset+i,n);return r.decodeUtf8(a)},e}(),l=function(){function e(e){this.batchDataUint8=e}return e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}(),f=function(){function e(e){this.batchDataUint8=e}return e.prototype.offset=function(e){return 0},e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof TextDecoder?new TextDecoder("utf-8"):null;t.decodeUtf8=r?r.decode.bind(r):function(e){var t=0,n=e.length,r=[],o=[];for(;t65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Math.pow(2,32),o=Math.pow(2,21)-1;function i(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}t.readInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},t.readUint32LE=i,t.readUint64LE=function(e,t){var n=i(e,t+4);if(n>o)throw new Error("Cannot read uint64 with high order part "+n+", because the result would exceed Number.MAX_SAFE_INTEGER.");return n*r+i(e,t)},t.readLEB128=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.MaximumFirstRetryInterval?e.MaximumFirstRetryInterval:t.retryIntervalMilliseconds,[4,this.delay(r)]):[3,7];case 2:if(o.sent(),this.isDisposed)return[3,7];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,this.reconnectCallback()];case 4:return o.sent()||this.reconnectDisplay.rejected(),[2];case 5:return i=o.sent(),this.logger.log(s.LogLevel.Error,i),[3,6];case 6:return n++,[3,1];case 7:return this.reconnectDisplay.failed(),[2]}}))}))},e.prototype.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e.MaximumFirstRetryInterval=3e3,e}()},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.getLoader=function(){var e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e},e}();t.DefaultReconnectDisplay=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,n,r){this.dialog=t,this.maxRetries=n,this.document=r,this.document=r;var o=this.document.getElementById(e.MaxRetriesId);o&&(o.innerText=this.maxRetries.toString())}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.update=function(t){var n=this.document.getElementById(e.CurrentAttemptId);n&&(n.innerText=t.toString())},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e.MaxRetriesId="components-reconnect-max-retries",e.CurrentAttemptId="components-reconnect-current-attempt",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return l})),n.d(t,"MessagePackHubProtocol",(function(){return u}));var r=n(10),o=n(11),i=n(2),a=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t},e}();var s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=3?e[2]:void 0,error:e[1],type:i.MessageType.Close}},e.prototype.createPingMessage=function(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:i.MessageType.Ping}},e.prototype.createInvocationMessage=function(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");var n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:i.MessageType.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:i.MessageType.Invocation}},e.prototype.createStreamItemMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:i.MessageType.StreamItem}},e.prototype.createCompletionMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");var n,r,o=t[3];if(o!==this.voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");switch(o){case this.errorResult:n=t[4];break;case this.nonVoidResult:r=t[4]}return{error:n,headers:e,invocationId:t[2],result:r,type:i.MessageType.Completion}},e.prototype.writeInvocation=function(e){var t,n=o(this.messagePackOptions);return t=e.streamIds?n.encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):n.encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),a.write(t.slice())},e.prototype.writeStreamInvocation=function(e){var t,n=o(this.messagePackOptions);return t=e.streamIds?n.encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):n.encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),a.write(t.slice())},e.prototype.writeStreamItem=function(e){var t=o(this.messagePackOptions).encode([i.MessageType.StreamItem,e.headers||{},e.invocationId,e.item]);return a.write(t.slice())},e.prototype.writeCompletion=function(e){var t,n=o(this.messagePackOptions),r=e.error?this.errorResult:e.result?this.nonVoidResult:this.voidResult;switch(r){case this.errorResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r,e.error]);break;case this.voidResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r]);break;case this.nonVoidResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r,e.result])}return a.write(t.slice())},e.prototype.writeCancelInvocation=function(e){var t=o(this.messagePackOptions).encode([i.MessageType.CancelInvocation,e.headers||{},e.invocationId]);return a.write(t.slice())},e.prototype.readHeaders=function(e){var t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t},e}(),l="5.0.1"}]); \ No newline at end of file diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs index 0e4731b29f72..faeefa78d4b8 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs @@ -34,7 +34,6 @@ public FileProviderRazorProjectFileSystem(RuntimeCompilationFileProvider filePro public IFileProvider FileProvider => _fileProvider.FileProvider; - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); @@ -96,4 +95,4 @@ private static string JoinPath(string path1, string path2) return path1 + "/" + path2; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/LazyMetadataReferenceFeature.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/LazyMetadataReferenceFeature.cs index 3f150a9a5dfb..fc4561319742 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/LazyMetadataReferenceFeature.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/LazyMetadataReferenceFeature.cs @@ -23,6 +23,8 @@ public LazyMetadataReferenceFeature(RazorReferenceManager referenceManager) /// public IReadOnlyList References => _referenceManager.CompilationReferences; +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0628 } } \ No newline at end of file diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs index 8113e1d6d4f5..011da238ef4d 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs @@ -77,7 +77,6 @@ public override IEnumerable FindHierarchicalItems(string baseP return Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs index 01e778ca9876..db97c2c2340b 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs @@ -18,7 +18,6 @@ public override IEnumerable EnumerateItems(string basePath) return directory?.EnumerateItems() ?? Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); @@ -44,4 +43,4 @@ public void Add(RazorProjectItem projectItem) _root.AddFile(new FileNode(filePath, projectItem)); } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/InjectDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/InjectDirective.cs index f5ea58312176..13d1fc60b0d0 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/InjectDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/InjectDirective.cs @@ -41,7 +41,7 @@ internal class Pass : IntermediateNodePassBase, IRazorDirectiveClassifierPass { // Runs after the @model and @namespace directives public override int Order => 10; - + protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) { var visitor = new Visitor(); @@ -104,21 +104,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - builder.AddTargetExtension(new InjectTargetExtension()); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/ModelDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/ModelDirective.cs index c16f46153ff6..cb15ba5c97ec 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/ModelDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/ModelDirective.cs @@ -126,20 +126,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/RazorExtensions.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/RazorExtensions.cs index 6fe73b57aeb7..faff5f9e6fc4 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/RazorExtensions.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/src/RazorExtensions.cs @@ -56,66 +56,5 @@ public static void RegisterViewComponentTagHelpers(RazorProjectEngineBuilder bui builder.Features.Add(new ViewComponentTagHelperPass()); builder.AddTargetExtension(new ViewComponentTagHelperTargetExtension()); } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static void Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - EnsureDesignTime(builder); - - InjectDirective.Register(builder); - ModelDirective.Register(builder); - - FunctionsDirective.Register(builder); - InheritsDirective.Register(builder); - - builder.Features.Add(new DefaultTagHelperDescriptorProvider()); - - // Register section directive with the 1.x compatible target extension. - builder.AddDirective(SectionDirective.Directive); - builder.Features.Add(new SectionDirectivePass()); - builder.AddTargetExtension(new LegacySectionTargetExtension()); - - builder.AddTargetExtension(new TemplateTargetExtension() - { - TemplateTypeName = "global::Microsoft.AspNetCore.Mvc.Razor.HelperResult", - }); - - builder.Features.Add(new ModelExpressionPass()); - builder.Features.Add(new MvcViewDocumentClassifierPass()); - } - - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static void RegisterViewComponentTagHelpers(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - EnsureDesignTime(builder); - - builder.Features.Add(new ViewComponentTagHelperDescriptorProvider()); - builder.Features.Add(new ViewComponentTagHelperPass()); - builder.AddTargetExtension(new ViewComponentTagHelperTargetExtension()); - } - -#pragma warning disable CS0618 // Type or member is obsolete - private static void EnsureDesignTime(IRazorEngineBuilder builder) -#pragma warning restore CS0618 // Type or member is obsolete - { - if (builder.DesignTime) - { - return; - } - - throw new NotSupportedException(Resources.RuntimeCodeGenerationNotSupported); - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/InjectDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/InjectDirectiveTest.cs index 63560c0f1f5f..1cbc887efef9 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/InjectDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/InjectDirectiveTest.cs @@ -172,7 +172,9 @@ private ClassDeclarationIntermediateNode FindClassNode(IntermediateNode node) return visitor.Node; } +#pragma warning disable CS0618 private RazorEngine CreateEngine() +#pragma warning restore CS0618 { var configuration = RazorConfiguration.Create(RazorLanguageVersion.Version_1_1, "test", Array.Empty()); return RazorProjectEngine.Create(configuration, RazorProjectFileSystem.Empty, b => @@ -183,7 +185,9 @@ private RazorEngine CreateEngine() }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -224,4 +228,4 @@ public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelDirectiveTest.cs index 7a4c811dbdad..f0a8a30cc178 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelDirectiveTest.cs @@ -236,17 +236,23 @@ private NamespaceDeclarationIntermediateNode FindNamespaceNode(IntermediateNode return visitor.Node; } +#pragma warning disable CS0618 private RazorEngine CreateRuntimeEngine() +#pragma warning restore CS0618 { return CreateEngineCore(); } +#pragma warning disable CS0618 private RazorEngine CreateDesignTimeEngine() +#pragma warning restore CS0618 { return CreateEngineCore(designTime: true); } +#pragma warning disable CS0618 private RazorEngine CreateEngineCore(bool designTime = false) +#pragma warning restore CS0618 { return CreateProjectEngine(b => { @@ -260,7 +266,9 @@ private RazorEngine CreateEngineCore(bool designTime = false) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -329,7 +337,9 @@ public DesignTimeOptionsFeature(bool designTime) public int Order { get; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorParserOptionsBuilder options) { @@ -342,4 +352,4 @@ public void Configure(RazorCodeGenerationOptionsBuilder options) } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelExpressionPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelExpressionPassTest.cs index 573159771f2b..58cbb982437d 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelExpressionPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ModelExpressionPassTest.cs @@ -149,7 +149,9 @@ private RazorCodeDocument CreateDocument(string content) return RazorCodeDocument.Create(source); } +#pragma warning disable CS0618 private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -157,7 +159,9 @@ private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -205,4 +209,4 @@ public override void VisitTagHelper(TagHelperIntermediateNode node) } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ViewComponentTagHelperPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ViewComponentTagHelperPassTest.cs index befa9d011c91..359a184b5303 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ViewComponentTagHelperPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ViewComponentTagHelperPassTest.cs @@ -206,7 +206,9 @@ private RazorCodeDocument CreateDocument(string content) return RazorCodeDocument.Create(source); } +#pragma warning disable CS0618 private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -216,7 +218,9 @@ private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/InjectDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/InjectDirective.cs index 9442aaf64164..3c7bea9586f7 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/InjectDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/InjectDirective.cs @@ -41,7 +41,7 @@ internal class Pass : IntermediateNodePassBase, IRazorDirectiveClassifierPass { // Runs after the @model and @namespace directives public override int Order => 10; - + protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) { var visitor = new Visitor(); @@ -104,21 +104,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - builder.AddTargetExtension(new InjectTargetExtension()); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/ModelDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/ModelDirective.cs index cf80df5f686c..47b27a978a30 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/ModelDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/ModelDirective.cs @@ -133,20 +133,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/NamespaceDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/NamespaceDirective.cs index de05d354b1fb..878ce92e4f3e 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/NamespaceDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/NamespaceDirective.cs @@ -128,7 +128,7 @@ internal static string GetNamespace(string source, DirectiveIntermediateNode dir // both 'view engine' style paths and absolute paths. // // We also don't normalize the separators here. We expect that all documents are using a consistent style of path. - // + // // If we can't normalize the path, we just return null so it will be ignored. private static string NormalizeDirectory(string path) { @@ -186,19 +186,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) base.VisitDirective(node); } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static void Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/PageDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/PageDirective.cs index 9b483f9b9f55..d9081a2057ae 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/PageDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/src/PageDirective.cs @@ -103,19 +103,5 @@ public override void VisitMalformedDirective(MalformedDirectiveIntermediateNode } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/AssemblyAttributeInjectionPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/AssemblyAttributeInjectionPassTest.cs index 3754276dbfc3..8fd929cbc2db 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/AssemblyAttributeInjectionPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/AssemblyAttributeInjectionPassTest.cs @@ -427,7 +427,9 @@ public void Execute_EscapesViewPathAndRouteWhenAddingAttributeToPage() node => Assert.Same(@namespace, node)); } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/InjectDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/InjectDirectiveTest.cs index ff128921c984..4539924f4cca 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/InjectDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/InjectDirectiveTest.cs @@ -171,8 +171,10 @@ private ClassDeclarationIntermediateNode FindClassNode(IntermediateNode node) return visitor.Node; } +#pragma warning disable CS0618 private RazorEngine CreateEngine() { +#pragma warning restore CS0618 return RazorProjectEngine.Create(b => { // Notice we're not registering the InjectDirective.Pass here so we can run it on demand. @@ -181,7 +183,9 @@ private RazorEngine CreateEngine() }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Test.csproj b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Test.csproj index da741703dcb5..4d4d2ee0fd51 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Test.csproj +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Test.csproj @@ -40,4 +40,4 @@ - \ No newline at end of file + diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelDirectiveTest.cs index d01195906be4..c5679ffbe833 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelDirectiveTest.cs @@ -234,17 +234,23 @@ private NamespaceDeclarationIntermediateNode FindNamespaceNode(IntermediateNode return visitor.Node; } +#pragma warning disable CS0618 private RazorEngine CreateRuntimeEngine() +#pragma warning restore CS0618 { return CreateEngineCore(); } +#pragma warning disable CS0618 private RazorEngine CreateDesignTimeEngine() +#pragma warning restore CS0618 { return CreateEngineCore(designTime: true); } +#pragma warning disable CS0618 private RazorEngine CreateEngineCore(bool designTime = false) +#pragma warning restore CS0618 { return CreateProjectEngine(b => { @@ -258,7 +264,9 @@ private RazorEngine CreateEngineCore(bool designTime = false) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -327,7 +335,9 @@ public DesignTimeOptionsFeature(bool designTime) public int Order { get; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorParserOptionsBuilder options) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelExpressionPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelExpressionPassTest.cs index cb3e7882ab6b..093fdd8766fc 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelExpressionPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ModelExpressionPassTest.cs @@ -149,7 +149,9 @@ private RazorCodeDocument CreateDocument(string content) return RazorCodeDocument.Create(source); } +#pragma warning disable CS0618 private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -157,7 +159,9 @@ private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/NamespaceDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/NamespaceDirectiveTest.cs index 8e5d76c6783a..c18812bfb471 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/NamespaceDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/NamespaceDirectiveTest.cs @@ -127,13 +127,15 @@ public void Pass_SetsNamespace_ComputedFromImports() var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); - + document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create("ignored", "/Account/Manage/AddUser.cshtml")); var pass = new NamespaceDirective.Pass(); +#pragma warning disable CS0618 pass.Engine = Mock.Of(); +#pragma warning restore CS0618 // Act pass.Execute(codeDocument, document); @@ -174,13 +176,15 @@ public void Pass_SetsNamespace_ComputedFromSource() var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); - + document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create("ignored", "/Account/Manage/AddUser.cshtml")); var pass = new NamespaceDirective.Pass(); +#pragma warning disable CS0618 pass.Engine = Mock.Of(); +#pragma warning restore CS0618 // Act pass.Execute(codeDocument, document); @@ -218,7 +222,9 @@ public void Pass_SetsNamespace_SanitizesClassAndNamespace() var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create("ignored", "/Account/Manage-Info/Add+User.cshtml")); var pass = new NamespaceDirective.Pass(); +#pragma warning disable CS0618 pass.Engine = Mock.Of(); +#pragma warning restore CS0618 // Act pass.Execute(codeDocument, document); @@ -259,13 +265,15 @@ public void Pass_SetsNamespace_ComputedFromSource_ForView() var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); - + document.DocumentKind = MvcViewDocumentClassifierPass.MvcViewDocumentKind; var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create("ignored", "/Account/Manage/AddUser.cshtml")); var pass = new NamespaceDirective.Pass(); +#pragma warning disable CS0618 pass.Engine = Mock.Of(); +#pragma warning restore CS0618 // Act pass.Execute(codeDocument, document); @@ -297,13 +305,15 @@ public void Pass_SetsNamespace_VerbatimFromImports() var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); - + document.DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind; var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create("ignored", "/Account/Manage/AddUser.cshtml")); var pass = new NamespaceDirective.Pass(); +#pragma warning disable CS0618 pass.Engine = Mock.Of(); +#pragma warning restore CS0618 // Act pass.Execute(codeDocument, document); @@ -333,13 +343,15 @@ public void Pass_DoesNothing_ForUnknownDocumentKind() var @class = new ClassDeclarationIntermediateNode() { ClassName = "default" }; builder.Add(@class); - + document.DocumentKind = null; var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create("ignored", "/Account/Manage/AddUser.cshtml")); var pass = new NamespaceDirective.Pass(); +#pragma warning disable CS0618 pass.Engine = Mock.Of(); +#pragma warning restore CS0618 // Act pass.Execute(codeDocument, document); diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/PageDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/PageDirectiveTest.cs index 1bdb156298fa..dd56aff4f471 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/PageDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/PageDirectiveTest.cs @@ -121,7 +121,9 @@ public void TryGetPageDirective_ParsesRouteTemplate() Assert.Equal("some-route-template", pageDirective.RouteTemplate); } +#pragma warning disable CS0618 private RazorEngine CreateEngine() +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -129,7 +131,9 @@ private RazorEngine CreateEngine() }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/RazorPageDocumentClassifierPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/RazorPageDocumentClassifierPassTest.cs index 4f895243bf32..d8f69bfe13e0 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/RazorPageDocumentClassifierPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/RazorPageDocumentClassifierPassTest.cs @@ -363,7 +363,9 @@ protected override void ConfigureProjectEngine(RazorProjectEngineBuilder builder PageDirective.Register(builder); } +#pragma warning disable CS0618 private static DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/InjectDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/InjectDirective.cs index 4282ea559f23..8d38be42bea7 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/InjectDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/InjectDirective.cs @@ -41,7 +41,7 @@ internal class Pass : IntermediateNodePassBase, IRazorDirectiveClassifierPass { // Runs after the @model and @namespace directives public override int Order => 10; - + protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) { if (documentNode.DocumentKind != RazorPageDocumentClassifierPass.RazorPageDocumentKind && @@ -111,21 +111,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - builder.AddTargetExtension(new InjectTargetExtension()); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/ModelDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/ModelDirective.cs index 4e0973f14a8c..70b508dd93b6 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/ModelDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/ModelDirective.cs @@ -140,20 +140,5 @@ public override void VisitDirective(DirectiveIntermediateNode node) } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PageDirective.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PageDirective.cs index 322c6564ef4a..421861e0b88a 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PageDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PageDirective.cs @@ -103,19 +103,5 @@ public override void VisitMalformedDirective(MalformedDirectiveIntermediateNode } } } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - return builder; - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PublicAPI.Shipped.txt b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PublicAPI.Shipped.txt index 163cddf34207..e646c4737e1c 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PublicAPI.Shipped.txt +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PublicAPI.Shipped.txt @@ -60,12 +60,9 @@ override Microsoft.AspNetCore.Mvc.Razor.Extensions.ViewComponentTagHelperPass.Or ~override Microsoft.AspNetCore.Mvc.Razor.Extensions.ViewComponentTagHelperIntermediateNode.FormatNode(Microsoft.AspNetCore.Razor.Language.Intermediate.IntermediateNodeFormatter formatter) -> void ~override Microsoft.AspNetCore.Mvc.Razor.Extensions.ViewComponentTagHelperIntermediateNode.WriteNode(Microsoft.AspNetCore.Razor.Language.CodeGeneration.CodeTarget target, Microsoft.AspNetCore.Razor.Language.CodeGeneration.CodeRenderingContext context) -> void ~override Microsoft.AspNetCore.Mvc.Razor.Extensions.ViewComponentTagHelperPass.ExecuteCore(Microsoft.AspNetCore.Razor.Language.RazorCodeDocument codeDocument, Microsoft.AspNetCore.Razor.Language.Intermediate.DocumentIntermediateNode documentNode) -> void -~static Microsoft.AspNetCore.Mvc.Razor.Extensions.InjectDirective.Register(Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder ~static Microsoft.AspNetCore.Mvc.Razor.Extensions.InjectDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder ~static Microsoft.AspNetCore.Mvc.Razor.Extensions.ModelDirective.GetModelType(Microsoft.AspNetCore.Razor.Language.Intermediate.DocumentIntermediateNode document) -> string -~static Microsoft.AspNetCore.Mvc.Razor.Extensions.ModelDirective.Register(Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder ~static Microsoft.AspNetCore.Mvc.Razor.Extensions.ModelDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder -~static Microsoft.AspNetCore.Mvc.Razor.Extensions.PageDirective.Register(Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder ~static Microsoft.AspNetCore.Mvc.Razor.Extensions.PageDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder ~static Microsoft.AspNetCore.Mvc.Razor.Extensions.PageDirective.TryGetPageDirective(Microsoft.AspNetCore.Razor.Language.Intermediate.DocumentIntermediateNode documentNode, out Microsoft.AspNetCore.Mvc.Razor.Extensions.PageDirective pageDirective) -> bool ~static Microsoft.AspNetCore.Mvc.Razor.Extensions.RazorExtensions.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> void diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/InjectDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/InjectDirectiveTest.cs index a935b23bfb12..9a4f2cd43189 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/InjectDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/InjectDirectiveTest.cs @@ -179,7 +179,9 @@ protected override void ConfigureProjectEngine(RazorProjectEngineBuilder builder builder.AddDirective(ModelDirective.Directive); } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -207,4 +209,4 @@ public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelDirectiveTest.cs index 527120915b4f..966016b715e1 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelDirectiveTest.cs @@ -234,17 +234,23 @@ private NamespaceDeclarationIntermediateNode FindNamespaceNode(IntermediateNode return visitor.Node; } +#pragma warning disable CS0618 private RazorEngine CreateRuntimeEngine() +#pragma warning restore CS0618 { return CreateEngineCore(designTime: false); } +#pragma warning disable CS0618 private RazorEngine CreateDesignTimeEngine() +#pragma warning restore CS0618 { return CreateEngineCore(designTime: true); } +#pragma warning disable CS0618 private RazorEngine CreateEngineCore(bool designTime = false) +#pragma warning restore CS0618 { return CreateProjectEngine(b => { @@ -257,7 +263,9 @@ private RazorEngine CreateEngineCore(bool designTime = false) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -311,7 +319,9 @@ public DesignTimeOptionsFeature(bool designTime) public int Order { get; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorParserOptionsBuilder options) { @@ -324,4 +334,4 @@ public void Configure(RazorCodeGenerationOptionsBuilder options) } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelExpressionPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelExpressionPassTest.cs index 8a9ecab95016..9cc64195a4b0 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelExpressionPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ModelExpressionPassTest.cs @@ -149,7 +149,9 @@ private RazorCodeDocument CreateDocument(string content) return RazorCodeDocument.Create(source); } +#pragma warning disable CS0618 private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -157,7 +159,9 @@ private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { @@ -205,4 +209,4 @@ public override void VisitTagHelper(TagHelperIntermediateNode node) } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/PageDirectiveTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/PageDirectiveTest.cs index 6cf27963587b..1c2b07d40985 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/PageDirectiveTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/PageDirectiveTest.cs @@ -121,7 +121,9 @@ public void TryGetPageDirective_ParsesRouteTemplate() Assert.Equal("some-route-template", pageDirective.RouteTemplate); } +#pragma warning disable CS0618 private RazorEngine CreateEngine() +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -129,7 +131,9 @@ private RazorEngine CreateEngine() }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/RazorPageDocumentClassifierPassTest.cs b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/RazorPageDocumentClassifierPassTest.cs index 779958703e13..a6fede418391 100644 --- a/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/RazorPageDocumentClassifierPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/RazorPageDocumentClassifierPassTest.cs @@ -358,7 +358,9 @@ public void RazorPageDocumentClassifierPass_AddsRouteTemplateMetadata() Assert.Equal("some-route", attributeNode.Value); } +#pragma warning disable CS0618 private RazorEngine CreateRuntimeEngine() +#pragma warning restore CS0618 { return CreateProjectEngine(b => { @@ -366,7 +368,9 @@ private RazorEngine CreateRuntimeEngine() }).Engine; } +#pragma warning disable CS0618 private static DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngine.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngine.cs index 27f22e01e3de..2d2ac46a8092 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngine.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngine.cs @@ -6,7 +6,9 @@ namespace Microsoft.AspNetCore.Razor.Language { +#pragma warning disable CS0618 internal class DefaultRazorEngine : RazorEngine +#pragma warning restore CS0618 { public DefaultRazorEngine(IRazorEngineFeature[] features, IRazorEnginePhase[] phases) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngineBuilder.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngineBuilder.cs index 50b3f1a6d252..8d4ce3c4417c 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngineBuilder.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorEngineBuilder.cs @@ -23,8 +23,10 @@ public DefaultRazorEngineBuilder(bool designTime) public bool DesignTime { get; } +#pragma warning disable CS0618 public RazorEngine Build() { +#pragma warning restore CS0618 var features = new IRazorEngineFeature[Features.Count]; Features.CopyTo(features, arrayIndex: 0); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngine.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngine.cs index a11e63cc9043..cd6ea34e1bf5 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngine.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngine.cs @@ -12,7 +12,9 @@ internal class DefaultRazorProjectEngine : RazorProjectEngine { public DefaultRazorProjectEngine( RazorConfiguration configuration, +#pragma warning disable CS0618 RazorEngine engine, +#pragma warning restore CS0618 RazorProjectFileSystem fileSystem, IReadOnlyList projectFeatures) { @@ -51,7 +53,9 @@ public DefaultRazorProjectEngine( public override RazorProjectFileSystem FileSystem { get; } +#pragma warning disable CS0618 public override RazorEngine Engine { get; } +#pragma warning restore CS0618 public override IReadOnlyList ProjectFeatures { get; } @@ -66,8 +70,8 @@ protected override RazorCodeDocument CreateCodeDocumentCore(RazorProjectItem pro } protected RazorCodeDocument CreateCodeDocumentCore( - RazorProjectItem projectItem, - Action configureParser, + RazorProjectItem projectItem, + Action configureParser, Action configureCodeGeneration) { if (projectItem == null) @@ -89,9 +93,9 @@ protected RazorCodeDocument CreateCodeDocumentCore( } protected internal RazorCodeDocument CreateCodeDocumentCore( - RazorSourceDocument sourceDocument, - string fileKind = null, - IReadOnlyList importSourceDocuments = null, + RazorSourceDocument sourceDocument, + string fileKind = null, + IReadOnlyList importSourceDocuments = null, IReadOnlyList tagHelpers = null, Action configureParser = null, Action configureCodeGeneration = null, @@ -165,9 +169,9 @@ protected RazorCodeDocument CreateCodeDocumentDesignTimeCore( } protected RazorCodeDocument CreateCodeDocumentDesignTimeCore( - RazorSourceDocument sourceDocument, - string fileKind, - IReadOnlyList importSourceDocuments, + RazorSourceDocument sourceDocument, + string fileKind, + IReadOnlyList importSourceDocuments, IReadOnlyList tagHelpers, Action configureParser, Action configureCodeGeneration) diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngineBuilder.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngineBuilder.cs index 4c79c767d8c1..1a719229a965 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngineBuilder.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectEngineBuilder.cs @@ -29,7 +29,7 @@ public DefaultRazorProjectEngineBuilder(RazorConfiguration configuration, RazorP public override ICollection Features { get; } public override IList Phases { get; } - + public override RazorProjectEngine Build() { #pragma warning disable CS0618 // Type or member is obsolete diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs index de7f34f5cd71..fa9f8a2c5b45 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs @@ -16,7 +16,7 @@ public DefaultRazorProjectFileSystem(string root) { throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(root)); } - + Root = root.Replace('\\', '/').TrimEnd('/'); } @@ -61,7 +61,6 @@ public override RazorProjectItem GetItem(string path, string fileKind) return new DefaultRazorProjectItem("/", filePath, relativePhysicalPath, fileKind, new FileInfo(absolutePath), cssScope: null); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs index 50849709af97..9061245b5fed 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs @@ -15,7 +15,6 @@ public override IEnumerable EnumerateItems(string basePath) return Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/FunctionsDirective.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/FunctionsDirective.cs index 8947e20134d9..eb6ce5655e9e 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/FunctionsDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/FunctionsDirective.cs @@ -26,19 +26,5 @@ public static void Register(RazorProjectEngineBuilder builder) builder.AddDirective(Directive, FileKinds.Legacy, FileKinds.Component); builder.Features.Add(new FunctionsDirectivePass()); } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static void Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new FunctionsDirectivePass()); - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/InheritsDirective.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/InheritsDirective.cs index 74fa396bcc57..4f4b6910b101 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/InheritsDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/InheritsDirective.cs @@ -28,19 +28,5 @@ public static void Register(RazorProjectEngineBuilder builder) builder.AddDirective(Directive, FileKinds.Legacy, FileKinds.Component, FileKinds.ComponentImport); builder.Features.Add(new InheritsDirectivePass()); } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static void Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new InheritsDirectivePass()); - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/SectionDirective.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/SectionDirective.cs index 9040e1868804..8e9b6095e8b2 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/SectionDirective.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/SectionDirective.cs @@ -28,20 +28,5 @@ public static void Register(RazorProjectEngineBuilder builder) builder.Features.Add(new SectionDirectivePass()); builder.AddTargetExtension(new SectionTargetExtension()); } - - #region Obsolete - [Obsolete("This method is obsolete and will be removed in a future version.")] - public static void Register(IRazorEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new SectionDirectivePass()); - builder.AddTargetExtension(new SectionTargetExtension()); - } - #endregion } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEngineFeature.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEngineFeature.cs index e06f3a65cef6..56702faf26dd 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEngineFeature.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEngineFeature.cs @@ -5,6 +5,8 @@ namespace Microsoft.AspNetCore.Razor.Language { public interface IRazorEngineFeature : IRazorFeature { +#pragma warning disable CS0618 RazorEngine Engine { get; set; } +#pragma warning restore CS0618 } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEnginePhase.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEnginePhase.cs index 0afcaaaa15fb..63f56b7960ae 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEnginePhase.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/IRazorEnginePhase.cs @@ -5,7 +5,9 @@ namespace Microsoft.AspNetCore.Razor.Language { public interface IRazorEnginePhase { +#pragma warning disable CS0618 RazorEngine Engine { get; set; } +#pragma warning restore CS0618 void Execute(RazorCodeDocument codeDocument); } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/PublicAPI.Shipped.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/PublicAPI.Shipped.txt index 585d72ed4f25..de81ace3e2fb 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/PublicAPI.Shipped.txt +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/PublicAPI.Shipped.txt @@ -340,7 +340,6 @@ Microsoft.AspNetCore.Razor.Language.RazorDiagnosticSeverity.Error = 3 -> Microso Microsoft.AspNetCore.Razor.Language.RazorDiagnosticSeverity.Warning = 2 -> Microsoft.AspNetCore.Razor.Language.RazorDiagnosticSeverity Microsoft.AspNetCore.Razor.Language.RazorEngine Microsoft.AspNetCore.Razor.Language.RazorEngine.RazorEngine() -> void -Microsoft.AspNetCore.Razor.Language.RazorEngineBuilderExtensions Microsoft.AspNetCore.Razor.Language.RazorEngineFeatureBase Microsoft.AspNetCore.Razor.Language.RazorEngineFeatureBase.RazorEngineFeatureBase() -> void Microsoft.AspNetCore.Razor.Language.RazorEngineFeatureBase.ThrowForMissingDocumentDependency(TDocumentDependency value) -> void @@ -1382,12 +1381,9 @@ virtual Microsoft.AspNetCore.Razor.Language.TagHelperDescriptorProviderContext.I ~static Microsoft.AspNetCore.Razor.Language.DirectiveTokenDescriptor.CreateToken(Microsoft.AspNetCore.Razor.Language.DirectiveTokenKind kind) -> Microsoft.AspNetCore.Razor.Language.DirectiveTokenDescriptor ~static Microsoft.AspNetCore.Razor.Language.DirectiveTokenDescriptor.CreateToken(Microsoft.AspNetCore.Razor.Language.DirectiveTokenKind kind, bool optional) -> Microsoft.AspNetCore.Razor.Language.DirectiveTokenDescriptor ~static Microsoft.AspNetCore.Razor.Language.DirectiveTokenDescriptor.CreateToken(Microsoft.AspNetCore.Razor.Language.DirectiveTokenKind kind, bool optional, string name, string description) -> Microsoft.AspNetCore.Razor.Language.DirectiveTokenDescriptor -~static Microsoft.AspNetCore.Razor.Language.Extensions.FunctionsDirective.Register(Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder) -> void ~static Microsoft.AspNetCore.Razor.Language.Extensions.FunctionsDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> void -~static Microsoft.AspNetCore.Razor.Language.Extensions.InheritsDirective.Register(Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder) -> void ~static Microsoft.AspNetCore.Razor.Language.Extensions.InheritsDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> void ~static Microsoft.AspNetCore.Razor.Language.Extensions.NamespaceDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder -~static Microsoft.AspNetCore.Razor.Language.Extensions.SectionDirective.Register(Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder) -> void ~static Microsoft.AspNetCore.Razor.Language.Extensions.SectionDirective.Register(Microsoft.AspNetCore.Razor.Language.RazorProjectEngineBuilder builder) -> void ~static Microsoft.AspNetCore.Razor.Language.FileKinds.GetComponentFileKindFromFilePath(string filePath) -> string ~static Microsoft.AspNetCore.Razor.Language.FileKinds.GetFileKindFromFilePath(string filePath) -> string @@ -1440,11 +1436,6 @@ virtual Microsoft.AspNetCore.Razor.Language.TagHelperDescriptorProviderContext.I ~static Microsoft.AspNetCore.Razor.Language.RazorEngine.CreateDesignTime(System.Action configure) -> Microsoft.AspNetCore.Razor.Language.RazorEngine ~static Microsoft.AspNetCore.Razor.Language.RazorEngine.CreateDesignTimeEmpty(System.Action configure) -> Microsoft.AspNetCore.Razor.Language.RazorEngine ~static Microsoft.AspNetCore.Razor.Language.RazorEngine.CreateEmpty(System.Action configure) -> Microsoft.AspNetCore.Razor.Language.RazorEngine -~static Microsoft.AspNetCore.Razor.Language.RazorEngineBuilderExtensions.AddDirective(this Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder, Microsoft.AspNetCore.Razor.Language.DirectiveDescriptor directive) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder -~static Microsoft.AspNetCore.Razor.Language.RazorEngineBuilderExtensions.AddTargetExtension(this Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder, Microsoft.AspNetCore.Razor.Language.CodeGeneration.ICodeTargetExtension extension) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder -~static Microsoft.AspNetCore.Razor.Language.RazorEngineBuilderExtensions.ConfigureClass(this Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder, System.Action configureClass) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder -~static Microsoft.AspNetCore.Razor.Language.RazorEngineBuilderExtensions.SetBaseType(this Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder, string baseType) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder -~static Microsoft.AspNetCore.Razor.Language.RazorEngineBuilderExtensions.SetNamespace(this Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder builder, string namespaceName) -> Microsoft.AspNetCore.Razor.Language.IRazorEngineBuilder ~static Microsoft.AspNetCore.Razor.Language.RazorLanguageVersion.Parse(string languageVersion) -> Microsoft.AspNetCore.Razor.Language.RazorLanguageVersion ~static Microsoft.AspNetCore.Razor.Language.RazorLanguageVersion.TryParse(string languageVersion, out Microsoft.AspNetCore.Razor.Language.RazorLanguageVersion version) -> bool ~static Microsoft.AspNetCore.Razor.Language.RazorParserOptions.Create(System.Action configure) -> Microsoft.AspNetCore.Razor.Language.RazorParserOptions diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngine.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngine.cs index 864c5c2da538..8b67ef364065 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngine.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngine.cs @@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Razor.Language { + [Obsolete("This class is obsolete and will be removed in a future version. The recommended alternative is " + nameof(RazorProjectEngine) + ".")] public abstract class RazorEngine { #pragma warning disable CS0618 // Type or member is obsolete @@ -193,3 +194,4 @@ public static RazorEngine CreateDesignTimeEmpty(Action conf } } + diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineBuilderExtensions.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineBuilderExtensions.cs deleted file mode 100644 index 43c011117c92..000000000000 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineBuilderExtensions.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Linq; -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Razor.Language -{ - /// - /// Extension methods to . - /// - [Obsolete("This class is obsolete and will be removed in a future version. The recommended alternative is " + nameof(RazorProjectEngineBuilderExtensions) + ".")] - public static class RazorEngineBuilderExtensions - { - /// - /// Adds the specified . - /// - /// The . - /// The to add. - /// The . - public static IRazorEngineBuilder AddDirective(this IRazorEngineBuilder builder, DirectiveDescriptor directive) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (directive == null) - { - throw new ArgumentNullException(nameof(directive)); - } - - var directiveFeature = GetDirectiveFeature(builder); - directiveFeature.Directives.Add(directive); - - return builder; - } - - /// - /// Adds the specified . - /// - /// The . - /// The to add. - /// The . - public static IRazorEngineBuilder AddTargetExtension(this IRazorEngineBuilder builder, ICodeTargetExtension extension) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (extension == null) - { - throw new ArgumentNullException(nameof(extension)); - } - - var targetExtensionFeature = GetTargetExtensionFeature(builder); - targetExtensionFeature.TargetExtensions.Add(extension); - - return builder; - } - - /// - /// Sets the base type for generated types. - /// - /// The . - /// The name of the base type. - /// The . - public static IRazorEngineBuilder SetBaseType(this IRazorEngineBuilder builder, string baseType) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - var configurationFeature = GetDefaultDocumentClassifierPassFeature(builder); - configurationFeature.ConfigureClass.Add((document, @class) => @class.BaseType = baseType); - return builder; - } - - /// - /// Registers a class configuration delegate that gets invoked during code generation. - /// - /// The . - /// invoked to configure - /// during code generation. - /// The . - public static IRazorEngineBuilder ConfigureClass( - this IRazorEngineBuilder builder, - Action configureClass) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (configureClass == null) - { - throw new ArgumentNullException(nameof(configureClass)); - } - - var configurationFeature = GetDefaultDocumentClassifierPassFeature(builder); - configurationFeature.ConfigureClass.Add(configureClass); - return builder; - } - - /// - /// Sets the namespace for generated types. - /// - /// The . - /// The name of the namespace. - /// The . - public static IRazorEngineBuilder SetNamespace(this IRazorEngineBuilder builder, string namespaceName) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - var configurationFeature = GetDefaultDocumentClassifierPassFeature(builder); - configurationFeature.ConfigureNamespace.Add((document, @namespace) => @namespace.Content = namespaceName); - return builder; - } - - private static IRazorDirectiveFeature GetDirectiveFeature(IRazorEngineBuilder builder) - { - var directiveFeature = builder.Features.OfType().FirstOrDefault(); - if (directiveFeature == null) - { - directiveFeature = new DefaultRazorDirectiveFeature(); - builder.Features.Add(directiveFeature); - } - - return directiveFeature; - } - - private static IRazorTargetExtensionFeature GetTargetExtensionFeature(IRazorEngineBuilder builder) - { - var targetExtensionFeature = builder.Features.OfType().FirstOrDefault(); - if (targetExtensionFeature == null) - { - targetExtensionFeature = new DefaultRazorTargetExtensionFeature(); - builder.Features.Add(targetExtensionFeature); - } - - return targetExtensionFeature; - } - - private static DefaultDocumentClassifierPassFeature GetDefaultDocumentClassifierPassFeature(IRazorEngineBuilder builder) - { - var configurationFeature = builder.Features.OfType().FirstOrDefault(); - if (configurationFeature == null) - { - configurationFeature = new DefaultDocumentClassifierPassFeature(); - builder.Features.Add(configurationFeature); - } - - return configurationFeature; - } - } -} diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineFeatureBase.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineFeatureBase.cs index d19d8ae489d9..9cfa01bfa077 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineFeatureBase.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEngineFeatureBase.cs @@ -8,9 +8,13 @@ namespace Microsoft.AspNetCore.Razor.Language { public abstract class RazorEngineFeatureBase : IRazorEngineFeature { +#pragma warning disable CS0618 private RazorEngine _engine; +#pragma warning restore CS0618 +#pragma warning disable CS0618 public RazorEngine Engine +#pragma warning restore CS0618 { get { return _engine; } set @@ -58,7 +62,9 @@ protected void ThrowForMissingFeatureDependency(TEngineDepend Resources.FormatFeatureDependencyMissing( GetType().Name, typeof(TEngineDependency).Name, +#pragma warning disable CS0618 typeof(RazorEngine).Name)); +#pragma warning restore CS0618 } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEnginePhaseBase.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEnginePhaseBase.cs index 460e3367d96c..9a55063ef330 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEnginePhaseBase.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorEnginePhaseBase.cs @@ -8,9 +8,13 @@ namespace Microsoft.AspNetCore.Razor.Language { public abstract class RazorEnginePhaseBase : IRazorEnginePhase { +#pragma warning disable CS0618 private RazorEngine _engine; +#pragma warning restore CS0618 +#pragma warning disable CS0618 public RazorEngine Engine +#pragma warning restore CS0618 { get { return _engine; } set @@ -73,7 +77,9 @@ protected void ThrowForMissingFeatureDependency(TEngineDepend Resources.FormatPhaseDependencyMissing( GetType().Name, typeof(TEngineDependency).Name, +#pragma warning disable CS0618 typeof(RazorEngine).Name)); +#pragma warning restore CS0618 } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs index 164d59e142d1..c92caf18432e 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs @@ -28,7 +28,6 @@ public abstract class RazorProject /// /// The path. /// The . - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public abstract RazorProjectItem GetItem(string path); /// @@ -50,7 +49,7 @@ public abstract class RazorProject /// traverses to the project root. /// e.g. /// /Views/Home/View.cshtml -> [ /Views/Home/FileName.cshtml, /Views/FileName.cshtml, /FileName.cshtml ] - /// + /// /// Project items returned by this method have inferred FileKinds from their corresponding file paths. /// public IEnumerable FindHierarchicalItems(string path, string fileName) @@ -70,7 +69,7 @@ public IEnumerable FindHierarchicalItems(string path, string f /// traverses to the . /// e.g. /// (/Views, /Views/Home/View.cshtml) -> [ /Views/Home/FileName.cshtml, /Views/FileName.cshtml ] - /// + /// /// Project items returned by this method have inferred FileKinds from their corresponding file paths. /// public virtual IEnumerable FindHierarchicalItems(string basePath, string path, string fileName) diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngine.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngine.cs index 1d664e8028eb..5560c11a521e 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngine.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngine.cs @@ -15,7 +15,9 @@ public abstract class RazorProjectEngine public abstract RazorProjectFileSystem FileSystem { get; } +#pragma warning disable CS0618 public abstract RazorEngine Engine { get; } +#pragma warning restore CS0618 public IReadOnlyList EngineFeatures => Engine.Features; @@ -54,7 +56,7 @@ public virtual RazorCodeDocument ProcessDesignTime(RazorSourceDocument source, s { throw new NotImplementedException(); } - + public virtual RazorCodeDocument ProcessDesignTime(RazorProjectItem projectItem) { if (projectItem == null) @@ -228,7 +230,7 @@ private static void AddComponentFeatures(RazorProjectEngineBuilder builder, Razo // Directive Classifier builder.Features.Add(new ComponentWhitespacePass()); - + // Optimization builder.Features.Add(new ComponentComplexAttributeContentPass()); builder.Features.Add(new ComponentLoweringPass()); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngineBuilderExtensions.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngineBuilderExtensions.cs index 89e809fb099c..378714da4087 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngineBuilderExtensions.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProjectEngineBuilderExtensions.cs @@ -17,7 +17,7 @@ public static class RazorProjectEngineBuilderExtensions /// Registers a class configuration delegate that gets invoked during code generation. /// /// The . - /// invoked to configure + /// invoked to configure /// during code generation. /// The . public static RazorProjectEngineBuilder ConfigureClass( @@ -215,7 +215,7 @@ public static RazorProjectEngineBuilder AddDefaultImports(this RazorProjectEngin { throw new ArgumentNullException(nameof(builder)); } - + builder.Features.Add(new AdditionalImportsProjectFeature(imports)); return builder; @@ -313,7 +313,9 @@ public ConfigureRootNamespaceFeature(string rootNamespace) public int Order { get; set; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorCodeGenerationOptionsBuilder options) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs index c6bf87efb0db..376ea47e9abb 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs @@ -19,7 +19,6 @@ public override IEnumerable EnumerateItems(string basePath) return directory?.EnumerateItems() ?? Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentDuplicateAttributeDiagnosticPassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentDuplicateAttributeDiagnosticPassTest.cs index fa6132337b21..8c968a6bedc8 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentDuplicateAttributeDiagnosticPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentDuplicateAttributeDiagnosticPassTest.cs @@ -30,10 +30,12 @@ public ComponentDuplicateAttributeDiagnosticPassTest() Pass.Engine = Engine; } - + private DefaultRazorProjectEngine ProjectEngine { get; } +#pragma warning disable CS0618 private RazorEngine Engine { get; } +#pragma warning restore CS0618 private ComponentMarkupDiagnosticPass Pass { get; } @@ -183,7 +185,9 @@ private DocumentIntermediateNode Lower(RazorCodeDocument codeDocument) private class StaticTagHelperFeature : ITagHelperFeature { +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public List TagHelpers { get; set; } @@ -193,4 +197,4 @@ public IReadOnlyList GetDescriptors() } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupBlockPassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupBlockPassTest.cs index 6c00e4f32227..eb3d8ce08a08 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupBlockPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupBlockPassTest.cs @@ -31,7 +31,9 @@ public ComponentMarkupBlockPassTest() private DefaultRazorProjectEngine ProjectEngine { get; } +#pragma warning disable CS0618 private RazorEngine Engine { get; } +#pragma warning restore CS0618 private ComponentMarkupBlockPass Pass { get; } @@ -471,7 +473,9 @@ private DocumentIntermediateNode Lower(RazorCodeDocument codeDocument) private class StaticTagHelperFeature : ITagHelperFeature { +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public List TagHelpers { get; set; } @@ -481,4 +485,4 @@ public IReadOnlyList GetDescriptors() } } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupEncodingPassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupEncodingPassTest.cs index 710d3d445760..bb01114e2987 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupEncodingPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentMarkupEncodingPassTest.cs @@ -31,7 +31,9 @@ public ComponentMarkupEncodingPassTest() private DefaultRazorProjectEngine ProjectEngine { get; } +#pragma warning disable CS0618 private RazorEngine Engine { get; } +#pragma warning restore CS0618 private ComponentMarkupEncodingPass Pass { get; } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentWhitespacePassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentWhitespacePassTest.cs index d2356ace8baa..ae028413f330 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentWhitespacePassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Components/ComponentWhitespacePassTest.cs @@ -31,7 +31,9 @@ public ComponentWhitespacePassTest() private DefaultRazorProjectEngine ProjectEngine { get; } +#pragma warning disable CS0618 private RazorEngine Engine { get; } +#pragma warning restore CS0618 private ComponentWhitespacePass Pass { get; } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs index 4d008b89d90a..8e46380783fc 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs @@ -525,7 +525,9 @@ public DesignTimeOptionsFeature(bool designTime) public int Order { get; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorParserOptionsBuilder options) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DirectiveRemovalOptimizationPassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DirectiveRemovalOptimizationPassTest.cs index 3e831b7d2350..5b71dece73f2 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DirectiveRemovalOptimizationPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DirectiveRemovalOptimizationPassTest.cs @@ -113,7 +113,9 @@ public void Execute_DirectiveWithError_PreservesDiagnosticsAndRemovesDirectiveNo Assert.Empty(method.Children); } +#pragma warning disable CS0618 private static DocumentIntermediateNode Lower(RazorCodeDocument codeDocument, RazorEngine engine) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DocumentClassifierPassBaseTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DocumentClassifierPassBaseTest.cs index e63768bf54c1..36a6aebb1de4 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DocumentClassifierPassBaseTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/DocumentClassifierPassBaseTest.cs @@ -15,7 +15,9 @@ public class DocumentClassifierPassBaseTest : RazorProjectEngineTestBase { protected override RazorLanguageVersion Version => RazorLanguageVersion.Latest; +#pragma warning disable CS0618 public RazorEngine Engine => CreateProjectEngine().Engine; +#pragma warning restore CS0618 [Fact] public void Execute_HasDocumentKind_IgnoresDocument() diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperOptimizationPassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperOptimizationPassTest.cs index 17a26bf20f71..275985cdedf5 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperOptimizationPassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperOptimizationPassTest.cs @@ -86,7 +86,9 @@ private RazorCodeDocument CreateDocument(string content) return RazorCodeDocument.Create(source); } +#pragma warning disable CS0618 private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { @@ -94,7 +96,9 @@ private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) }).Engine; } +#pragma warning disable CS0618 private DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperTargetExtensionTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperTargetExtensionTest.cs index fba53cd721c4..644ff633af23 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperTargetExtensionTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/DefaultTagHelperTargetExtensionTest.cs @@ -1083,7 +1083,7 @@ public void WriteTagHelperRuntime_DesignTime_RendersPreRequisites() // Arrange var extension = new DefaultTagHelperTargetExtension(); var context = TestCodeRenderingContext.CreateDesignTime(); - + var node = new DefaultTagHelperRuntimeIntermediateNode(); // Act @@ -1108,7 +1108,7 @@ public void WriteTagHelperRuntime_Runtime_DeclaresRequiredFields() // Arrange var extension = new DefaultTagHelperTargetExtension(); var context = TestCodeRenderingContext.CreateRuntime(); - + var node = new DefaultTagHelperRuntimeIntermediateNode(); // Act @@ -1231,7 +1231,9 @@ public DesignTimeOptionsFeature(bool designTime) public int Order { get; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorParserOptionsBuilder options) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/InheritsDirectivePassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/InheritsDirectivePassTest.cs index e851990b8031..c7b6678cc7e3 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/InheritsDirectivePassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/InheritsDirectivePassTest.cs @@ -69,7 +69,9 @@ public void Execute_Inherits_SetsClassDeclarationBaseType() Assert.Equal("Hello", @class.BaseType); } +#pragma warning disable CS0618 private static DocumentIntermediateNode Lower(RazorCodeDocument codeDocument, RazorEngine engine) +#pragma warning restore CS0618 { for (var i = 0; i < engine.Phases.Count; i++) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/MetadataAttributePassTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/MetadataAttributePassTest.cs index db50c00268fc..fc6a0c078aee 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/MetadataAttributePassTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/Extensions/MetadataAttributePassTest.cs @@ -381,7 +381,9 @@ public void Execute_HasRequiredInfo_AndImport_AddsItemAndSourceChecksum() Assert.Equal("/Foo/Import.cshtml", checksum.Identifier); } +#pragma warning disable CS0618 private static RazorEngine CreateEngine() +#pragma warning restore CS0618 { return RazorProjectEngine.Create(b => { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/RazorEngineBuilderExtensionsTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/RazorEngineBuilderExtensionsTest.cs deleted file mode 100644 index 3df637cadca2..000000000000 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/RazorEngineBuilderExtensionsTest.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Linq; -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; -using Xunit; - -namespace Microsoft.AspNetCore.Razor.Language -{ -#pragma warning disable CS0618 // Type or member is obsolete - public class RazorEngineBuilderExtensionsTest - { - [Fact] - public void AddDirective_ExistingFeature_UsesFeature() - { - // Arrange - var expected = new DefaultRazorDirectiveFeature(); - var engine = RazorEngine.CreateEmpty(b => - { - b.Features.Add(expected); - - // Act - b.AddDirective(DirectiveDescriptor.CreateDirective("test", DirectiveKind.SingleLine)); - }); - - // Assert - var actual = Assert.Single(engine.Features.OfType()); - Assert.Same(expected, actual); - - var directive = Assert.Single(actual.Directives); - Assert.Equal("test", directive.Directive); - } - - [Fact] - public void AddDirective_NoFeature_CreatesFeature() - { - // Arrange - var engine = RazorEngine.CreateEmpty(b => - { - // Act - b.AddDirective(DirectiveDescriptor.CreateDirective("test", DirectiveKind.SingleLine)); - }); - - // Assert - var actual = Assert.Single(engine.Features.OfType()); - Assert.IsType(actual); - - var directive = Assert.Single(actual.Directives); - Assert.Equal("test", directive.Directive); - } - - [Fact] - public void AddTargetExtensions_ExistingFeature_UsesFeature() - { - // Arrange - var extension = new MyTargetExtension(); - - var expected = new DefaultRazorTargetExtensionFeature(); - var engine = RazorEngine.CreateEmpty(b => - { - b.Features.Add(expected); - - // Act - b.AddTargetExtension(extension); - }); - - // Assert - var actual = Assert.Single(engine.Features.OfType()); - Assert.Same(expected, actual); - - Assert.Same(extension, Assert.Single(actual.TargetExtensions)); - } - - [Fact] - public void AddTargetExtensions_NoFeature_CreatesFeature() - { - // Arrange - var extension = new MyTargetExtension(); - - var engine = RazorEngine.CreateEmpty(b => - { - // Act - b.AddTargetExtension(extension); - }); - - // Assert - var actual = Assert.Single(engine.Features.OfType()); - Assert.IsType(actual); - - Assert.Same(extension, Assert.Single(actual.TargetExtensions)); - } - - private class MyTargetExtension : ICodeTargetExtension - { - } - } -#pragma warning restore CS0618 // Type or member is obsolete -} diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs index 1c4faa7b5b81..a3d5d3d0f21d 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs @@ -26,7 +26,6 @@ public override IEnumerable EnumerateItems(string basePath) throw new NotImplementedException(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs index 092851d31108..93b0662620dc 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs @@ -27,7 +27,6 @@ public override IEnumerable EnumerateItems(string basePath) } } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/GenerateCommand.cs b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/GenerateCommand.cs index 229d62a0404f..d1730055b566 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/GenerateCommand.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/GenerateCommand.cs @@ -400,7 +400,9 @@ public SourceItem(string sourcePath, string outputPath, string physicalRelativeP private class StaticTagHelperFeature : ITagHelperFeature { +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public IReadOnlyList TagHelpers { get; set; } diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/BindTagHelperDescriptorProvider.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/BindTagHelperDescriptorProvider.cs index 22eeb425b070..d09374e8f0b7 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/BindTagHelperDescriptorProvider.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/BindTagHelperDescriptorProvider.cs @@ -15,7 +15,9 @@ internal class BindTagHelperDescriptorProvider : ITagHelperDescriptorProvider // Run after the component tag helper provider, because we need to see the results. public int Order { get; set; } = 1000; +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Execute(TagHelperDescriptorProviderContext context) { diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/EventHandlerTagHelperDescriptorProvider.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/EventHandlerTagHelperDescriptorProvider.cs index 25bc587b47c0..68c7d2eb6cce 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/EventHandlerTagHelperDescriptorProvider.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/EventHandlerTagHelperDescriptorProvider.cs @@ -13,7 +13,9 @@ internal class EventHandlerTagHelperDescriptorProvider : ITagHelperDescriptorPro { public int Order { get; set; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Execute(TagHelperDescriptorProviderContext context) { diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/KeyTagHelperDescriptorProvider.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/KeyTagHelperDescriptorProvider.cs index 789abca3183a..4ec68fe42067 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/KeyTagHelperDescriptorProvider.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/KeyTagHelperDescriptorProvider.cs @@ -12,7 +12,9 @@ internal class KeyTagHelperDescriptorProvider : ITagHelperDescriptorProvider // Run after the component tag helper provider public int Order { get; set; } = 1000; +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Execute(TagHelperDescriptorProviderContext context) { diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/RazorProjectEngineBuilderExtensions.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/RazorProjectEngineBuilderExtensions.cs index aa07cd9cf6ad..5256a5511272 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/RazorProjectEngineBuilderExtensions.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/RazorProjectEngineBuilderExtensions.cs @@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.Razor public static class RazorProjectEngineBuilderExtensions { /// - /// Sets the C# language version to target when generating code. + /// Sets the C# language version to target when generating code. /// /// The . /// The C# . @@ -51,7 +51,9 @@ public ConfigureParserForCSharpVersionFeature(LanguageVersion csharpLanguageVers public int Order { get; set; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorCodeGenerationOptionsBuilder options) { @@ -78,7 +80,7 @@ public void Configure(RazorCodeGenerationOptionsBuilder options) // to act in a safe manner to not cause unneeded errors for older compilers. Therefore if the version isn't // >= 8.0 (Latest has a higher value) then nullability enforcement is suppressed. // - // Once the project finishes configuration the C# language version will be updated to reflect the effective + // Once the project finishes configuration the C# language version will be updated to reflect the effective // language version for the project by our workspace change detectors. That mechanism extracts the correlated // Roslyn project and acquires the effective C# version at that point. options.SuppressNullabilityEnforcement = false; diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs index 1eafca4181e8..e1926a7748b7 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs @@ -12,7 +12,9 @@ internal class RefTagHelperDescriptorProvider : ITagHelperDescriptorProvider // Run after the component tag helper provider, because later we may want component-type-specific variants of this public int Order { get; set; } = 1000; +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Execute(TagHelperDescriptorProviderContext context) { diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/SplatTagHelperDescriptorProvider.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/SplatTagHelperDescriptorProvider.cs index 3d6421442726..624e6e663a5d 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/SplatTagHelperDescriptorProvider.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/SplatTagHelperDescriptorProvider.cs @@ -12,7 +12,9 @@ internal class SplatTagHelperDescriptorProvider : ITagHelperDescriptorProvider // Order doesn't matter public int Order { get; set; } +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Execute(TagHelperDescriptorProviderContext context) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/RazorIntegrationTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/RazorIntegrationTestBase.cs index 07f4572c5b01..69977b98ff94 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/RazorIntegrationTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/RazorIntegrationTestBase.cs @@ -216,7 +216,7 @@ protected CompileToCSharpResult CompileToCSharp(string cshtmlRelativePath, strin // Result of doing 'temp' compilation var tempAssembly = CompileToAssembly(declaration, throwOnFailure); - // Add the 'temp' compilation as a metadata reference + // Add the 'temp' compilation as a metadata reference var references = BaseCompilation.References.Concat(new[] { tempAssembly.Compilation.ToMetadataReference() }).ToArray(); projectEngine = CreateProjectEngine(Configuration, references); @@ -438,7 +438,9 @@ private class SuppressChecksum : IConfigureRazorCodeGenerationOptionsFeature { public int Order => 0; +#pragma warning disable CS0618 public RazorEngine Engine { get; set; } +#pragma warning restore CS0618 public void Configure(RazorCodeGenerationOptionsBuilder options) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorEngineBuilderExtensions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorEngineBuilderExtensions.cs deleted file mode 100644 index 3d7977ea2dfa..000000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorEngineBuilderExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language.IntegrationTests; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Razor.Language -{ - [Obsolete("This class is obsolete and will be removed in a future version.")] - public static class RazorEngineBuilderExtensions - { - public static IRazorEngineBuilder AddTagHelpers(this IRazorEngineBuilder builder, params TagHelperDescriptor[] tagHelpers) - { - return AddTagHelpers(builder, (IEnumerable)tagHelpers); - } - - public static IRazorEngineBuilder AddTagHelpers(this IRazorEngineBuilder builder, IEnumerable tagHelpers) - { - var feature = (TestTagHelperFeature)builder.Features.OfType().FirstOrDefault(); - if (feature == null) - { - feature = new TestTagHelperFeature(); - builder.Features.Add(feature); - } - - feature.TagHelpers.AddRange(tagHelpers); - return builder; - } - - public static IRazorEngineBuilder ConfigureDocumentClassifier(this IRazorEngineBuilder builder) - { - var feature = builder.Features.OfType().FirstOrDefault(); - if (feature == null) - { - feature = new DefaultDocumentClassifierPassFeature(); - builder.Features.Add(feature); - } - - feature.ConfigureNamespace.Clear(); - feature.ConfigureClass.Clear(); - feature.ConfigureMethod.Clear(); - - feature.ConfigureNamespace.Add((RazorCodeDocument codeDocument, NamespaceDeclarationIntermediateNode node) => - { - node.Content = "Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles"; - }); - - feature.ConfigureClass.Add((RazorCodeDocument codeDocument, ClassDeclarationIntermediateNode node) => - { - node.ClassName = IntegrationTestBase.FileName.Replace('/', '_'); - node.Modifiers.Clear(); - node.Modifiers.Add("public"); - }); - - feature.ConfigureMethod.Add((RazorCodeDocument codeDocument, MethodDeclarationIntermediateNode node) => - { - node.Modifiers.Clear(); - node.Modifiers.Add("public"); - node.Modifiers.Add("async"); - node.MethodName = "ExecuteAsync"; - node.ReturnType = typeof(Task).FullName; - }); - - return builder; - } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorProjectEngineTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorProjectEngineTestBase.cs index 5c655150fffd..94a2f5b814e4 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorProjectEngineTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/RazorProjectEngineTestBase.cs @@ -13,7 +13,9 @@ protected virtual void ConfigureProjectEngine(RazorProjectEngineBuilder builder) { } +#pragma warning disable CS0618 protected RazorEngine CreateEngine() => CreateProjectEngine().Engine; +#pragma warning restore CS0618 protected RazorProjectEngine CreateProjectEngine() { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs index ed8383a9f5b2..943becf2e93d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs @@ -28,7 +28,6 @@ public override IEnumerable EnumerateItems(string basePath) throw new NotImplementedException(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null);