Esri / arcgis-js-vscode-snippets

Collection of Visual Studio Code snippets for common code patterns in the ArcGIS Maps SDK for JavaScript.
https://marketplace.visualstudio.com/items?itemName=Esri.arcgis-maps-sdk-js-snippets
Apache License 2.0
25 stars 8 forks source link

Small refactor on getApi, map snippets and tsConfig #18

Closed hhkaos closed 11 months ago

hhkaos commented 3 years ago

I just realized the current tsConfig snippet has some typos (missing commas): Screenshot 2021-07-20 at 19 52 19

So I fixed it.

Then I tried to make it work but I got this: Screenshot 2021-07-20 at 19 52 57

I have used another version https://github.com/Esri/jsapi-resources/blob/master/4.x/typescript/demo/tsconfig.json which seems to be similar but with a different target, but it worked for me. Am I doing something wrong?, should we change the target.

Then the tsConfigBasicdidn't work for me either: Screenshot 2021-07-20 at 20 03 52

So I proposed replaced it with `"target": "es2019",' which fixed it to me.

Cheers!

hhkaos commented 3 years ago

I'm trying and maybe this would be even better:

{
  "compilerOptions": {
    "module": "amd", // output files as AMD modules
    "sourceMap": true,
    "target": "es2019",
    "esModuleInterop": true
  }
}

Does it have any problem? I'm new with TS 😄

andygup commented 3 years ago

I just opened an issue to better doc the minimum req's for TS in the System Requirements doc. Targeting es2019 or higher is currently what we recommend and we'll doc that.

kellyhutchins commented 3 years ago

@hhkaos I think we probably want to keep the jsxFactory and jsx options for those doing widget development but I do think the shorter snippet with es2019 looks good and we should update to that.

hhkaos commented 3 years ago

Great Kelly, I just added the jsxFactory and updated the contributing.md with some of the things we discussed 😄 .