Skip to content

Commit 8b6b947

Browse files
authored
fix(playground): tsx support in editor (#12599)
1 parent dbfe7c5 commit 8b6b947

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.yarn/patches/playground-elements-npm-0.18.1-d292eadd94.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,16 @@ index 1c2996fe16a91fe52074e65144aca9e1098043fd..4259730b04a73d0f5f5fec00d558d97c
117117
], PlaygroundPreview.prototype, "iframe", void 0);
118118
__decorate([
119119
query('slot')
120+
diff --git a/playground-typescript-worker.js b/playground-typescript-worker.js
121+
index 764edfea8a536a660ad983d0aeb369c064ebfc22..6ff369d0bd0c28f80d83868932171c3608806a8a 100644
122+
--- a/playground-typescript-worker.js
123+
+++ b/playground-typescript-worker.js
124+
@@ -58,7 +58,7 @@ class G{constructor(e,t){this._emittedExternalDependencies=new Set,this._nodeRes
125+
* @license
126+
* Copyright 2021 Google LLC
127+
* SPDX-License-Identifier: BSD-3-Clause
128+
- */const se={target:ae.ScriptTarget.ES2021,module:ae.ModuleKind.ESNext,experimentalDecorators:!0,skipDefaultLibCheck:!0,skipLibCheck:!0,allowJs:!0,moduleResolution:ae.ModuleResolutionKind.NodeNext,jsx:ae.JsxEmit.React,lib:["dom","esnext"]};class ce{constructor(){this.compilerOptions=se,this.serviceHost=new _e(self.origin,se),this.service=ae.createLanguageService(this.serviceHost,ae.createDocumentRegistry())}}class _e{constructor(e,t){this.files=new Map,this.packageRoot=e,this.compilerOptions=t}updateFileContentIfNeeded(e,t){const n=this.files.get(e);n&&n.content!==t?(n.content=t,n.version+=1):this.files.set(e,{content:t,version:0})}sync(e){e.forEach(((e,t)=>this.updateFileContentIfNeeded(t,e))),this._removeDeletedFiles(e)}_removeDeletedFiles(e){this.getScriptFileNames().forEach((t=>{t.includes("node_modules")||e.has(t)||this.files.delete(t)}))}getCompilationSettings(){return this.compilerOptions}getScriptFileNames(){return[...this.files.keys()]}getScriptVersion(e){var t,n;return null!==(n=null===(t=this.files.get(e))||void 0===t?void 0:t.version.toString())&&void 0!==n?n:"-1"}fileExists(e){return this.files.has(e)}readFile(e){var t;return null===(t=this.files.get(e))||void 0===t?void 0:t.content}getScriptSnapshot(e){if(this.fileExists(e))return ae.ScriptSnapshot.fromString(this.readFile(e))}getCurrentDirectory(){return this.packageRoot}getDefaultLibFileName(){return"__lib.d.ts"}}
129+
+ */const se={target:ae.ScriptTarget.ES2021,module:ae.ModuleKind.ESNext,experimentalDecorators:!0,skipDefaultLibCheck:!0,skipLibCheck:!0,allowJs:!0,moduleResolution:ae.ModuleResolutionKind.NodeNext,jsx:ae.JsxEmit.ReactJSX,jsxImportSource:"@ui5/webcomponents-base",lib:["dom","esnext"]};class ce{constructor(){this.compilerOptions=se,this.serviceHost=new _e(self.origin,se),this.service=ae.createLanguageService(this.serviceHost,ae.createDocumentRegistry())}}class _e{constructor(e,t){this.files=new Map,this.packageRoot=e,this.compilerOptions=t}updateFileContentIfNeeded(e,t){const n=this.files.get(e);n&&n.content!==t?(n.content=t,n.version+=1):this.files.set(e,{content:t,version:0})}sync(e){e.forEach(((e,t)=>this.updateFileContentIfNeeded(t,e))),this._removeDeletedFiles(e)}_removeDeletedFiles(e){this.getScriptFileNames().forEach((t=>{t.includes("node_modules")||e.has(t)||this.files.delete(t)}))}getCompilationSettings(){return this.compilerOptions}getScriptFileNames(){return[...this.files.keys()]}getScriptVersion(e){var t,n;return null!==(n=null===(t=this.files.get(e))||void 0===t?void 0:t.version.toString())&&void 0!==n?n:"-1"}fileExists(e){return this.files.has(e)}readFile(e){var t;return null===(t=this.files.get(e))||void 0===t?void 0:t.content}getScriptSnapshot(e){if(this.fileExists(e))return ae.ScriptSnapshot.fromString(this.readFile(e))}getCurrentDirectory(){return this.packageRoot}getDefaultLibFileName(){return"__lib.d.ts"}}
130+
/**
131+
* @license
132+
* Copyright 2021 Google LLC

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20628,7 +20628,7 @@ __metadata:
2062820628

2062920629
"playground-elements@patch:playground-elements@npm%3A0.18.1#~/.yarn/patches/playground-elements-npm-0.18.1-d292eadd94.patch":
2063020630
version: 0.18.1
20631-
resolution: "playground-elements@patch:playground-elements@npm%3A0.18.1#~/.yarn/patches/playground-elements-npm-0.18.1-d292eadd94.patch::version=0.18.1&hash=14946a"
20631+
resolution: "playground-elements@patch:playground-elements@npm%3A0.18.1#~/.yarn/patches/playground-elements-npm-0.18.1-d292eadd94.patch::version=0.18.1&hash=d2f81e"
2063220632
dependencies:
2063320633
"@material/mwc-button": "npm:^0.27.0"
2063420634
"@material/mwc-icon-button": "npm:^0.27.0"
@@ -20642,7 +20642,7 @@ __metadata:
2064220642
lit: "npm:^2.0.0"
2064320643
tslib: "npm:^2.0.3"
2064420644
vscode-languageserver-protocol: "npm:^3.17.2"
20645-
checksum: 10c0/5f45e0c6be484a4232a9bfacf446b3c658f1a128d8717374f75d29b9018c620a43fbc4ce1250e951f2e07063b87cc10938b39a25bf701ac81d79e776fa3f5ace
20645+
checksum: 10c0/89e23e4858bd23205d494ae6d6615fbdcc4409a821da9dbdbe0c4f5ec8f880471167843b7be18bc39e401cd97a411495eb18f48429a136b1a9dbd458b3ec3fb1
2064620646
languageName: node
2064720647
linkType: hard
2064820648

0 commit comments

Comments
 (0)