Azure / Azure/azure-functions-nodejs-library
Reduce confusion for "magic" binding expressions
- Vorherrschende Sprache
- TypeScript
- Sterne
- 70
- Forks
- 35
- Ø Merge
- 4 T. 18 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
We've had several people get confused by these (example [1](https://github.com/Azure/azure-functions-nodejs-library/issues/103), [2](https://github.com/Azure/azure-functions-nodejs-library/issues/84), [3](https://github.com/Azure/azure-functions-nodejs-library/discussions/152#discussioncomment-7209198)). I think the main problem is that these are hard-coded string values that basically perform magic under the covers and the documentation is hard-to-find. Would be nice if we could add some Intellisense or helper methods to make it easier to understand.
Example [binding expression](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-expressions-patterns):
```typescript
const blobOutput = output.storageBlob({
connection: "AzureWebJobsStorage",
path: "helloworld/{DateTime:MM-dd-yyyy H:mm:ss}.json",
});
```
Example [route parameter](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?pivots=programming-language-javascript#using-route-parameters):
```typescript
app.http('httpTrigger1', {
methods: ['GET', 'POST'],
authLevel: 'anonymous',
route: 'httpTrigger1/{id}',
handler: httpTrigger1
});
```
Beitragsleitfaden
Rechercherichtung
Beginne mit der Prüfung der APIs output.storageBlob und app.http sowie der verknüpften Dokumentation zu binding-expression und route-parameter und der zugehörigen Issues. Lege fest, ob das Ziel IntelliSense, Hilfsmethoden oder beides ist, und bestätige anschließend, dass die resultierende API Binding-Ausdrücke und Routenparameter auffindbar macht, ohne auf fest codierte Strings angewiesen zu sein.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- azure, typescript
- Bereich
- backend-api-design, developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100