- Notifications
You must be signed in to change notification settings - Fork 15
Adding 2 snippets: add basemapStyle and adding 4.19 to getAPI #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
RalucaNicola left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andygup what do you think about the ImportESM snippet? I feel like that is one way of working with esm. If users install them using node modules (which is what I guess most of our users would do) then the imports will look different. I'm not sure this is a super useful snippet.
The basemap style is good to go in my opinion.
snippets/html.json Outdated
| "\t", | ||
| "\tesriConfig.apiKey = \"YOUR_FREE_API_KEY_FROM_DEVELOPERS.ARCGIS.COM\";", | ||
| "\t", | ||
| "\tconst view = new MapView({", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between this and the CreateMap code snippet? https://github.com/Esri/arcgis-js-vscode-snippets/blob/master/snippets/javascript.json#L88
Back then we discussed that we don't want to import modules, we leave that up to the user's dev setup to be taken care of. There are many ways for a user to do that and we don't want to give them more work by having to delete our imports...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it is pretty similar, the main difference was the import modules. Btw, since the MapView is capable of autocast the map why do we still import the Map class and generate a variable just for the view?. In my case, I try to avoid declaring variables whenever is possible, and this is usually one of those cases.
Anyway, I think in the end, I think it is very subjective, and the type of snippets a developer would like to have/use will depend on the type of projects they use to work on (client-side, server-side, 2D, 3D, ...), so I feel that the coolest thing would be to explain how to customize the extension with your own snippets, leave it clear a contributing guide (include in the contributing.md things like what you just explained here), and in the best scenario... have something like Bootstrap customize with community contributions, allowing the developer to choose which ones likes to them 😄 (too much maybe? hehe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing @hhkaos! I agree with @RalucaNicola that most (majority) of users are using local builds. My primary concern with the importESM snippet is that we don't want to give anyone the impression that they can use the ESM CDN in production applications. From a performance perspective, it's our most inefficient build and should only be used for prototyping and testing. Instead we are promoting npm installs of the ES modules as the best way to do local builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Andy, I understand. So I'll remove it and try not to add more than one snippet per PR too ^_^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. One last recommendation, if you are able to wait 9 - 10 more days you can add this snippet along with the 4.20 release:
"<script src=\"https://js.arcgis.com/${2|4.19,4.18,4.17,4.16,4.15,4.14|}\"></script>"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
you can add several snippets Raul, it's just that we want to stay away from using imports in them because there are several ways to import modules -> with a good setup, the editor should do that for you anyway
-
as Andi said ESM CDN is more for small demos rather than production apps
-
to answer your question about the map variable, I need the map to add layers or to find a certain layer. I guess I use a map variable to avoid having to go through the view to get it. But it's a matter of personal preference in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
But it's a matter of personal preference in the end.
Yes you are right. In my case I think it adds extra complexity for new developers so in most cases I just try to use view.map.
| In conclusion:
@kellyhutchins can you make a new release after UC or whenever you have a bit of time? |
| I updated the comment because I thought Raul can also update the release number :D |
| Thanks @RalucaNicola, done!. About the release number I wasn't sure what to add so |
| Thanks for the contribution! I am going to work on cleaning up a few of my older snippets and get the extension republished later this week. |
| thank you @kellyhutchins, if that's OK, I'll be soon doing more contributions 💪 😄 |
I just wanted to do my first contribution to this project adding two very basic snippets 😄