Skip to content

Commit 50bb7f8

Browse files
authored
docs: update overviews with recent library improvements (#9777)
* docs: update overviews with recent library improvements * make docs preview even easier * update more docs * begin adding ember docs * add all the docs
1 parent 7a40c35 commit 50bb7f8

File tree

22 files changed

+925
-389
lines changed

22 files changed

+925
-389
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ jobs:
6565
)
6666
name: Enable All In progress features
6767
env:
68-
EMBER_DATA_FEATURE_OVERRIDE: ENABLE_ALL_OPTIONAL
68+
WARP_DRIVE_FEATURE_OVERRIDE: ENABLE_ALL_OPTIONAL
6969
run: pnpm test
7070
- if: |
7171
github.event_name == 'pull_request' && (
7272
github.base_ref == 'main' || github.base_ref == 'beta'
7373
)
7474
name: Disabled All In progress features
7575
env:
76-
EMBER_DATA_FEATURE_OVERRIDE: DISABLE_ALL
76+
WARP_DRIVE_FEATURE_OVERRIDE: DISABLE_ALL
7777
run: pnpm test
7878
- if: |
7979
github.event_name == 'pull_request' && (

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ WarpDrive provides features that make it easy to build scalable, fast, feature
3232
rich application — letting you ship better experiences more quickly without re-architecting your app or API. WarpDrive is:
3333

3434
- ⚡️ Committed to Best-In-Class Performance
35-
- 🌲 Focused on being as svelte as possible
36-
- 🚀 SSR Ready
3735
- 💚 Typed
38-
- 🔜 works with any framework
39-
- ⚛️ Supports any API: `GraphQL` `JSON:API` `REST` `tRPC` ...bespoke or a mix
36+
- ⚛️ Works with any API
37+
- 🌲 Focused on being as tiny as possible
38+
- 🚀 SSR Ready
39+
- 🔜 Seamless reactivity in any framework
4040
- 🐹 Built with ♥️ by [Ember](https://emberjs.com)
4141

4242
<br>

contributing/writing-api-docs.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ it becomes best to know the underlying parser is YUIDoc.
88
While API Documentation lives with the source-code, the code itself plays no-part in the documentation
99
that is generated: everything is compiled from comments alone.
1010

11+
The below guide will walk through best practices for writing doc comments, important
12+
nuances and syntaxes to know, as well as how to test and preview the doc comments.
13+
1114
<br>
1215

1316
---

docs-generator/yuidoc.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"url": "https://github.com/emberjs/data",
55
"options": {
66
"enabledEnvironments": [],
7-
"extension": ".js,.ts",
7+
"extension": ".js,.ts,.gts,.gjs",
88
"preprocessor": "./yui-docs-preprocessor.js",
99
"excludeTags": ["internal", "feature", "typedoc", "see", "link", "inheritdoc"],
1010
"paths": [
@@ -23,7 +23,9 @@
2323
"../packages/graph/src",
2424
"../packages/legacy-compat/src",
2525
"../packages/tracking/src",
26-
"../packages/request/src"
26+
"../packages/request/src",
27+
"../packages/schema-record/src",
28+
"../packages/ember/src"
2729
],
2830
"exclude": "vendor",
2931
"outdir": "../packages/-ember-data/dist/docs"

docs-viewer/src/-utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function repoDetails(gitUrl: string) {
7676
installPathFromRoot,
7777
location,
7878
relativePath: path.relative(__dirname, path.join(docsViewerRoot, installPathFromRoot)),
79+
httpsUrl: `https://github.com/${repoPath}.git`,
7980
};
8081
}
8182

docs-viewer/src/preview-docs.ts

+12
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ async function cloneRepo(details: ReturnType<typeof repoDetails>) {
101101
cwd: docsViewerRoot,
102102
});
103103
await proc.exited;
104+
105+
// if the clone fails for publicKey we try https
106+
if (proc.exitCode !== 0) {
107+
const reason = await new Response(proc.stderr).text();
108+
if (reason.includes('publickey')) {
109+
log(`Cloning ${chalk.green(details.repoPath)} to ${chalk.green(relativePath)} using https`);
110+
const proc2 = Bun.spawn(['git', 'clone', details.httpsUrl, relativePath, '--depth=1'], {
111+
cwd: docsViewerRoot,
112+
});
113+
await proc2.exited;
114+
}
115+
}
104116
}
105117

106118
async function main() {

packages/-ember-data/README.md

+66-133
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,39 @@
1515
/>
1616
</p>
1717

18-
<p align="center">The lightweight reactive data library for JavaScript applications</p>
19-
20-
[![Build Status](https://github.com/emberjs/data/workflows/CI/badge.svg)](https://github.com/emberjs/data/actions?workflow=CI)
21-
[![Discord Community Server](https://img.shields.io/discord/480462759797063690.svg?logo=discord)](https://discord.gg/zT3asNS)
18+
<p align="center">
19+
<br>
20+
<a href="https://warp-drive.io">EmberData</a> is a lightweight data library for web apps &mdash;
21+
<br>
22+
universal, typed, reactive, and ready to scale.
23+
<br/><br/>
24+
<p>
25+
26+
![NPM Stable Version](https://img.shields.io/npm/v/ember-data/latest?label=version&style=flat&color=FFC474)
27+
![NPM Downloads](https://img.shields.io/npm/dm/ember-data.svg?style=flat&color=FFC474)
28+
![License](https://img.shields.io/github/license/emberjs/data.svg?style=flat&color=FFC474)
29+
[![Docs](./logos/docs-badge.svg)](https://api.emberjs.com/ember-data/release)
30+
[![Discord Community Server](https://img.shields.io/badge/Discord-grey?logo=discord&logoColor=FFC474)](https://discord.gg/zT3asNS
31+
)
2232

2333
---
2434

25-
Wrangle your application's data management with scalable patterns for developer productivity.
35+
> [!TIP]
36+
> EmberData is going universal and rebranding as WarpDrive
37+
> with support for any signals based reactive framework!
38+
>
39+
> This means you may already see some references to WarpDrive.
40+
41+
EmberData provides features that make it easy to build scalable, fast, feature
42+
rich application &mdash; letting you ship better experiences more quickly without re-architecting your app or API. EmberData is:
2643

2744
- ⚡️ Committed to Best-In-Class Performance
28-
- 🌲 Focused on being as svelte as possible
45+
- 💚 Typed
46+
- ⚛️ Works with any API
47+
- 🌲 Focused on being as tiny as possible
2948
- 🚀 SSR Ready
30-
- 🔜 Typescript Support
49+
- 🔜 Seamless reactivity in any framework
3150
- 🐹 Built with ♥️ by [Ember](https://emberjs.com)
32-
- ⚛️ Supports any API: `GraphQL` `JSON:API` `REST` `tRPC` ...bespoke or a mix
3351

3452
**Tagged Releases**
3553

@@ -39,42 +57,25 @@ Wrangle your application's data management with scalable patterns for developer
3957
- ![NPM LTS Version](https://img.shields.io/npm/v/ember-data/lts?label=%40lts&color=0096FF)
4058
- ![NPM LTS 4.12 Version](https://img.shields.io/npm/v/ember-data/lts-4-12?label=%40lts-4-12&color=bbbbbb)
4159

42-
### 📖 On This Page
60+
## Quick Links
4361

44-
- [Overview](#overview)
45-
- [Architecture](#-architecture)
62+
- Getting Started
4663
- [Basic Installation](#basic-installation)
4764
- [Advanced Installation](#advanced-installation)
48-
- [Configuration](#configuration)
49-
- [Deprecation Stripping](#deprecation-stripping)
50-
- [randomUUID polyfill](#randomuuid-polyfill)
51-
- [Removing inspector support in production](#removing-inspector-support-in-production)
52-
- [Debugging](#debugging)
53-
- [Contributing](#contributing)
54-
55-
# Overview
56-
57-
*Ember***Data** is a lightweight reactive data library for JavaScript applications that provides composable primitives for ordering query/mutation/peek flows, managing network and cache, and reducing data for presentation.
58-
59-
- [API Documentation](https://api.emberjs.com/ember-data/release)
60-
- [Community & Help](https://emberjs.com/community)
61-
- [Contributing Guide](./CONTRIBUTING.md)
62-
- [Usage Guide](https://guides.emberjs.com/release/models/)
63-
- [RFCs](https://github.com/emberjs/rfcs/labels/T-ember-data)
64-
- [Team](https://emberjs.com/team)
65-
- [Blog](https://emberjs.com/blog)
66-
67-
## 🪜 Architecture
68-
69-
*Ember***Data** is both _resource_ centric and _document_ centric in it's approach to caching, requesting and presenting data. Your application's configuration and usage drives which is important and when.
70-
71-
The `Store` is a **coordinator**. When using a `Store` you configure what cache to use, how cache data should be presented to the UI, and where it should look for requested data when it is not available in the cache.
72-
73-
This coordination is handled opaquely to the nature of the requests issued and the format of the data being handled. This approach gives applications broad flexibility to configure *Ember***Data** to best suite their needs. This makes *Ember***Data** a powerful solution for applications regardless of their size and complexity.
74-
75-
*Ember***Data** is designed to scale, with a religious focus on performance and asset-size to keep its footprint small but speedy while still being able to handle large complex APIs in huge data-driven applications with no additional code and no added application complexity. It's goal is to prevent applications from writing code to manage data that is difficult to maintain or reason about.
76-
77-
*Ember***Data**'s power comes not from specific features, data formats, or adherence to specific API specs such as `JSON:API` `trpc` or `GraphQL`, but from solid conventions around requesting and mutating data developed over decades of experience scaling developer productivity.
65+
- [Configuration](https://github.com/emberjs/data/blob/main/packages/build-config/README.md)
66+
- Learn
67+
- [API Documentation](https://api.emberjs.com/ember-data/release)
68+
- [New Guides (🚧 WIP)](https://github.com/emberjs/data/blob/main/guides/index.md)
69+
- [Community Resources](https://github.com/emberjs/data/blob/main/guides/community-resources.md)
70+
- [Ember Usage Guide](https://guides.emberjs.com/release/models/)
71+
- [Ember Tutorial](https://guides.emberjs.com/release/tutorial/part-1/)
72+
- Get Involved
73+
- [Discord Community](https://discord.com/invite/emberjs)
74+
- [Community & Help](https://emberjs.com/community)
75+
- [Contributing](https://github.com/emberjs/data/blob/main/CONTRIBUTING.md)
76+
- [RFCs](https://github.com/emberjs/rfcs/labels/T-ember-data)
77+
- [Team](https://emberjs.com/team)
78+
- [Blog](https://emberjs.com/blog)
7879

7980
## Basic Installation
8081

@@ -91,101 +92,33 @@ not wish to use `ember-data`, remove `ember-data` from your project's `package.j
9192

9293
## Advanced Installation
9394

94-
*Ember***Data** is organized into primitives that compose together via public APIs.
95-
96-
- [@ember-data/request](./packages/request) provides managed `fetch` via its RequestManager and can be used without any other parts of EmberData.
97-
- [@ember-data/store](./packages/store) is the "core" of EmberData and handles coordination between the RequestManager, the Cache, and Presentation Concerns.
98-
- [@ember-data/tracking](./packages/tracking) is currently required when using the core and provides tracking primitives for change notification of Tracked properties.
99-
- [@ember-data/json-api](./packages/json-api) is a resource cache for JSON:API structured data. It integrates with the store via the hook `createCache`
100-
- [@ember-data/model](./packages/model) is a presentation layer, it integrates with the store via the hooks `instantiateRecord` and `teardownRecord`.
101-
- [@ember-data/debug](./packages/debug) provides (optional) debugging support for the `ember-inspector`.
102-
103-
104-
Some EmberData APIs are older than others, and these still interop via well-defined public API boundaries but are
105-
no longer the ideal approach.
106-
107-
- [@ember-data/legacy-compat](./packages/legacy-compat) provides support for older paradigms that are being phased out
108-
- [@ember-data/adapter](./packages/adapter) provides various network API integrations for APIS built over specific REST or JSON:API conventions. It integrates with the Store via `store.adapterFor`, and with the request pipeline via the `LegacyNetworkHandler` available via `@ember-data/legacy-compat` which utilizes the Minimum Adapter Interface.
109-
- [@ember-data/serializer](./packages/serializer) pairs with `@ember-data/adapter` and the `LegacyNetworkHandler` to normalize and serialize data to and from an API format into the `JSON:API` format understood by `@ember-data/json-api`.
95+
*Ember***Data** is organized into primitives that compose together via public APIs. These primitives are organized into
96+
small packages encapsulating these boundaries. These packages
97+
declare peer-dependencies (sometimes optional peer dependencies)
98+
on the other *Ember***Data**/*Warp***Drive** packages they require use of.
99+
100+
- [@ember-data/request](../packages/request) provides managed `fetch`
101+
- [@ember-data/request-utils](../packages/request-utils) provides optional utilities for managing requests and string manipulation
102+
- [@ember-data/store](../packages/store) provides core functionality around coordinating caching and reactivity
103+
- [@ember-data/tracking](../packages/tracking) enables integration with Ember's reactivity system
104+
- [@ember-data/json-api](../packages/json-api) provides a cache for data in the [{JSON:API}](https://jsonapi.org) format.
105+
- [@ember-data/debug](../packages/debug) provides (optional) debugging support for the `ember-inspector`.
106+
- [@warp-drive/build-config](../packages/build-config) provides a build plugin which ensures proper settings configuration for deprecations, optional features, development/testing support and debug logging.
107+
- [@warp-drive/core-types](../packages/core-types) provides core types and symbols used by all other packages
108+
- [@warp-drive/schema-record](../packages/schema-record) provides a flexible, schema-based approach to reactive data.
109+
- [@warp-drive/ember](../packages/ember) provides Ember specific components and utilities for reactive control-flow and declarative state management.
110+
111+
Some EmberData APIs are older than others, and these still interop via well-defined
112+
public API boundaries but are no longer the ideal approach.
113+
114+
- [@ember-data/model](../packages/model) provides a class-based approach to declaring schemas for reactive data.
115+
- [@ember-data/legacy-compat](../packages/legacy-compat) provides support for the older adapter/serializer request paradigm that is being phased out
116+
- [@ember-data/adapter](../packages/adapter) provides various network API integrations for APIs built over specific REST or `{JSON:API}` conventions.
117+
- [@ember-data/serializer](../packages/serializer) provides an approach to normalizing and serializing data to and from an API format into the `{JSON:API}` format.
110118

111119
And finally:
112120

113-
- [ember-data](./packages/-ember-data) is a "meta" package which bundles all of these together for convenience
114-
115-
The packages interop with each other through well defined public API boundaries. The core
116-
of the library is the store provided by `@ember-data/store`, while each of the other libraries plugs into the store when installed. Because these packages interop via fully
117-
public APIs, other libraries or applications may provide their own implementations. For instance, [ember-m3](https://github.com/hjdivad/ember-m3) is a commonly used presentation and cache implementation suitable for complex resource objects and graphs.
118-
119-
## Configuration
120-
121-
### Deprecation Stripping
122-
123-
*Ember***Data** allows users to opt-in and remove code that exists to support deprecated behaviors.
124-
125-
If your app has resolved all deprecations present in a given version, you may specify that version as your "compatibility" version to remove the code that supported the deprecated behavior from your app.
126-
127-
```ts
128-
let app = new EmberApp(defaults, {
129-
emberData: {
130-
compatWith: '4.8',
131-
},
132-
});
133-
```
134-
135-
- [Full Documentation](https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fdeprecations)
136-
137-
### randomUUID polyfill
138-
139-
*Ember***Data** uses `UUID V4` by default to generate identifiers for new data created on the client. Identifier generation is configurable, but we also for convenience will polyfill
140-
the necessary feature if your browser support or deployment environment demands it. To
141-
activate this polyfill:
142-
143-
```ts
144-
let app = new EmberApp(defaults, {
145-
emberData: {
146-
polyfillUUID: true,
147-
},
148-
});
149-
```
150-
151-
### removing inspector support in production
152-
153-
If you do not want to ship inspector support in your production application, you can specify
154-
that all support for it should be stripped from the build.
155-
156-
```ts
157-
let app = new EmberApp(defaults, {
158-
emberData: {
159-
includeDataAdapterInProduction: false,
160-
},
161-
});
162-
```
163-
164-
- [Full Documentation](https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fdebug)
165-
166-
### Debugging
167-
168-
Many portions of the internals are helpfully instrumented with logging that can be activated
169-
at build time. This instrumentation is always removed from production builds or any builds
170-
that has not explicitly activated it. To activate it set the appropriate flag to `true`.
171-
172-
```ts
173-
let app = new EmberApp(defaults, {
174-
emberData: {
175-
debug: {
176-
LOG_PAYLOADS: false, // data store received to update cache with
177-
LOG_OPERATIONS: false, // updates to cache remote state
178-
LOG_MUTATIONS: false, // updates to cache local state
179-
LOG_NOTIFICATIONS: false,
180-
LOG_REQUESTS: false, // log Requests issued via the request manager
181-
LOG_REQUEST_STATUS: false,
182-
LOG_IDENTIFIERS: false,
183-
LOG_GRAPH: false, // relationship storage
184-
LOG_INSTANCE_CACHE: false, // instance creation/deletion
185-
},
186-
},
187-
});
188-
```
121+
- [ember-data](./packages/-ember-data) is a "meta" package which bundles many of these together for convenience in a "legacy" configuration.
189122

190123
### License
191124

0 commit comments

Comments
 (0)