Comments (2)
I approve this motion!
edit: @bobaaaaa
if there is only one main type section
, why do we need subtypes in the first place? maybe promote all suggested subtypes to main types instead?
from tapir.
That could theoretically also work. The thing is, in paper we have a union (base) type for all pages (section & all articles). That means the typescript compiler would see something like this:
// with type "section" + subtypes
function foo(page: Page) {
// page.type === 'article' | 'video' | 'gallery' | 'embed' | 'external' | 'author' | 'section'
if (page.type === 'section') {
// do something on all sections
}
}
// with type "frontpage", "advertorial" + no subtypes
function foo(page: Page) {
// page.type === 'article' | 'video' | 'gallery' | 'embed' | 'external' | 'author' | 'frontpage' | 'advertorial'
if (page.type === 'frontpage' || page.type === 'advertorial') {
// do something on all sections
}
}
That is sometimes also hard for the article pages. There is no "base" identifier for content/detail pages.
from tapir.
Related Issues (20)
- Technical timestamps in metadata HOT 3
- Add example of nested elements to documentation
- Remove Asset.index
- stages: references
- core: BodyNodes re-implementation HOT 1
- node: bump to latest node LTS (14)
- page: SectionPage with References for canonical link HOT 1
- protoc 3.15.0
- Document release process
- Document versioning HOT 2
- automate generation and addition of go code HOT 1
- evaluate Buf Schema Registry (BSR) HOT 3
- Cleanup `ContentSubType` enum
- ContentType: Do we need IMAGE and AGENCY?
- `make test` without node/node-legacy HOT 3
- Node: create executable client HOT 1
- Deprecate node package: tapir-v1-legacy
- [node] try to connect bufbuild/protobuf-es with @grpc/grpc-js
- bug: fundoc generation is broken
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 tapir.