starter's People
Forkers
suica programmermark xiaoxiangmoe bittttter ronesam collisioncataclysm bronifty alvinbcn80 eiis adriangonz97 jordan-hallstarter's Issues
WISH: webextension / webworker
Hi,
It would be neat if the sample also had the option to run on the webworker, as a webextension.
This, possibly, would mean to include this (or similar logic?): https://github.com/volarjs/vscode-typescript-web
This could also, ofc, be a wish for a separate repo, starter-webworker, to not clutter this one :)
Bad `umd2esm` plugin in `build.js` script
Description
starter/packages/vscode/scripts/build.js
Lines 22 to 27 in 45c67d8
The code above will convert umd
imports to esm
by replacing "umd" with "esm" in the filepath.
However, the path generated no longer work for vscode-uri
as of 3.0.8.
The path for umd
import is "lib/umd/index.js"
, but the path for esm
import is "lib/esm/index.mjs"
. As the script replaces "lib/umd/index.js"
with "lib/esm/index.js"
, esbuild fails to resolve the esm
import.
Reference to the commit that changes the export path for
esm
: microsoft/vscode-uri@53e4ca6#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R9
See the error my Github Action that builds my VSCode extension : https://github.com/bywhitebird/kazam/actions/runs/6483646531/job/17608453201#step:5:218
Steps to Reproduce
Use vscode-uri>=3.0.8
.
Solutions
I managed to build my VSCode extension with this code:
build.onResolve({ filter: /^(vscode-.*|estree-walker|jsonc-parser)/ }, (args) => {
const pathUmdMay = require.resolve(args.path, { paths: [args.resolveDir] })
// Call twice the replace is to solve the problem of the path in Windows
let pathEsm = pathUmdMay.replace('/umd/', '/esm/').replace('\\umd\\', '\\esm\\')
// Try to resolve the path
// If it fails, if the file extension is .js, try to replace it with .mjs
try {
require.resolve(pathEsm, { paths: [args.resolveDir] })
}
catch {
if (pathEsm.endsWith('.js'))
pathEsm = pathEsm.replace(/\.js$/, '.mjs')
}
return { path: pathEsm }
})
This code tries to resolve the new path. If it fails, it tries to resolve the import by replacing .js
with .mjs
.
It works, but I think it is still not robust enough. Another solution might be considered.
Sample does not handle TS correctly
Hi,
Just wanted to let you know that the starter-sample does not handle TS:
The issue seems to be that typescript does not 'know' the file-extension. Breakpoint inside typescript.js:
message: 'File .../starter/sample/test.html1 has unknown extension.'
The Readme.md does not say it supports TS either, probably a good idea to update it :)
//E
WISH: Add the monaco editor to sample
Recent threads has shown there are issues with getting the @volar/monaco package to work from version 2.x of volar:
volarjs/volar.js#151
It would be a good idea to add the implementation of the monaco-client to the starter
`TypeError:` Cannot read properties of undefined (reading 'roots')
Got this error from launched client on fresh installation.
TypeError: Cannot read properties of undefined (reading 'roots') at Nu.createEmbeddedCodes (d:\html1\language-tools\packages\vscode\dist\server.js:1093:39919) at createEmbeddedCodes.next () at new Nu (d:\html1\language-tools\packages\vscode\dist\server.js:1093:39731) at Object.createVirtualCode (d:\html1\language-tools\packages\vscode\dist\server.js:1093:39040) at Object.set (d:\html1\language-tools\packages\vscode\dist\server.js:2:11051) at d:\html1\language-tools\packages\vscode\dist\server.js:75:5729 at Object.get (d:\html1\language-tools\packages\vscode\dist\server.js:2:10370) at fx (d:\html1\language-tools\packages\vscode\dist\server.js:2:30946) at E5 (d:\html1\language-tools\packages\vscode\dist\server.js:2:30811) at Object.findDocumentSymbols (d:\html1\language-tools\packages\vscode\dist\server.js:2:67746)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.