Comments (7)
Q6: I prefer the snippet name too we'll just need to ensure that we add info to the readme to let users know how these snippets within snippets work.
Q7: For simplicity sake I think we should leave out the placeholder that shows the options. I worry that it will be too hard to maintain and as you noted if users are working with the jsapi types they already get that info.
Q8: Interesting approach. I like it and think it would be a nice option that makes it generic.
Q9: I think it would be useful to have snippets for the enums and like the idea of adding the enum suffix.
from arcgis-js-vscode-snippets.
Let me share the notes from the meeting @kellyhutchins, @RalucaNicola and @ak-kemp just add.
From what I understood, we have agreed on the following:
Q0) Do we use \t instead of spaces?
We agreed on using \t
Q1) The snippet should contain a new class initialization, its constructor properties, or both?
We agreed on both are OK for JavaScript.
For TypeScript only the "new ... " version.
We agreed on adding the suffix "Props" to the version just with the properties (without "new").
Q2) When creating new class, do we also assign it to a variable?
We agreed on not assigning it to a variable
Q3) Should we avoid adding multiple expressions in one snippet?.
We agreed on trying to keep snippets small and try not to instantiate more than one class whenever possible.
Q4) Do we allow comments?
We agreed on not using comments. Use the description instead.
Q5) When instantiating a new class, do we add only required fields, the most common ones, all?
We think there is no unique answer for this. Try to use the most common ones but it will need to be checked case by case. We agreed on sorting properties by alphabetical order.
Please correct me if I understood something wrong.
Cheers
from arcgis-js-vscode-snippets.
I agree with Kelly on the last 4 questions, nothing to add.
from arcgis-js-vscode-snippets.
@hhkaos I think we can follow the same guidelines used here in the JSAPI resources: https://github.com/Esri/jsapi-resources/blob/main/.prettierrc.json
from arcgis-js-vscode-snippets.
Yuhu!, so we got to an agreement then. I will add the agreements to https://github.com/Esri/arcgis-js-vscode-snippets/blob/master/contributing.md :)
from arcgis-js-vscode-snippets.
@kellyhutchins I think we should also add to the guidelines that after a colon, there needs to be a single space " ".
I'm not sure about singles quotes vs double quotes vs backticks 😅, do we follow any rule/convention?.
from arcgis-js-vscode-snippets.
I think we can follow the same guidelines used here in the JSAPI resources: Esri/jsapi-resources@main/.prettierrc.json
Perfect!, we will have to include that in the contributing guidelines.
Another question related to the body conventions.
Properties for autocasting vs constructors
I have noticed most of the snippets today contain properties for autocasting:
{
type: "polygon-3d",
symbolLayers: [{
type: "fill",
pattern: {
type: "style",
style: "${1|solid,vertical,horizontal,forward-diagonal,diagonal-cross,cross,backward-diagonal|}"
},
material: { color: ${2:[255, 250, 239, 0.8]} },
outline: { color: ${3:[70, 70, 70, 0.7]}}
}]
}
But it could also be:
new PolygonSymbol3D({
symbolLayers: [{
type: "fill",
pattern: {
type: "style",
style: "${1|solid,vertical,horizontal,forward-diagonal,diagonal-cross,cross,backward-diagonal|}"
},
material: { color: ${2:[255, 250, 239, 0.8]} },
outline: { color: ${3:[70, 70, 70, 0.7]}}
}]
})
Almost the same except for the type: "polygon-3d",
many times needed for autocasting.
Should we remain consistent and recommend one approach versus the other? Or any rule to when to go for one vs the other? I just feel it can get messy and end-up having random patterns.
Raul
P.S. if we are OK with both, I wonder if we should apply different conventions for each (e.g. common properties vs all properties).
from arcgis-js-vscode-snippets.
Related Issues (20)
- Snippets cheatsheet HOT 7
- Add Snippets builder to enhance the contribution experience HOT 4
- Snippet proposal: Load a MapView (2D) HOT 2
- Snippet proposal: Find a layer by it's name HOT 4
- Snippet "name" conventions
- Snippet "description" conventions HOT 4
- Review existing JavaScript snippets (conventions) HOT 4
- Customize icon for snippets suggestions HOT 1
- Programmatically create UI/cheat sheet to explore snippets HOT 1
- Add snippets for all Symbol classes HOT 1
- Add snippets for all Layer classes HOT 1
- Add basic snippets
- Improve contributing guidelines
- Update extension icon
- 🎃 𝗛𝗮𝗰𝗸𝘁𝗼𝗯𝗲𝗿𝗳𝗲𝘀𝘁 𝗗𝗲𝘁𝗮𝗶𝗹𝘀 𝗳𝗼𝗿 𝗣𝗮𝗿𝘁𝗶𝗰𝗶𝗽𝗮𝗻𝘁𝘀 👨💻
- Add snippets for Search widget (different configurations)
- Enhance snippets to work with basemaps (using API keys) & JS SDK 4.x HOT 1
- Enhance snippets builder
- Improve contributing guidelines HOT 1
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.
from arcgis-js-vscode-snippets.