Skip to content

Commit 5ee6de0

Browse files
committed
Cleaning up..
1 parent 39e78d3 commit 5ee6de0

File tree

5 files changed

+97
-136
lines changed

5 files changed

+97
-136
lines changed

src/content/docs/reference/terminology.mdx

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,32 @@ This section provides definitions for common terms used throughout the 1fe ecosy
2020

2121
### 1fe
2222

23-
A micro-frontend platform that standardizes development, deployment, and execution of frontend experiences. 1fe provides shared utilities and governance controls through a centralized platform team while allowing individual teams to focus on creating unique user experiences.
23+
A micro-frontend platform that standardizes development, deployment, and execution of frontend experiences. 1fe provides shared utilities and governance controls through a centralized platform team while allowing individual teams to focus on creating unique user experiences. The main repository is available on [GitHub](https://github.com/docusign/1fe).
2424

25-
### 1fe Instance [[memory:5051784]]
25+
### 1fe Instance
2626

27-
A hosted application that runs the 1fe platform for your organization. This is the main application that serves as the runtime environment for all widgets and plugins in your ecosystem.
27+
A hosted application that runs the 1fe platform for your organization. This is the main application that serves as the runtime environment for all widgets and plugins in your ecosystem. You can get started with the [1fe-starter-app](https://github.com/docusign/1fe-starter-app) template.
2828

2929
### CI/CD
3030

31-
Continuous Integration/Continuous Deployment. 1fe provides standardized pipeline templates through `1fe-ci-cd` to ensure consistent building, testing, and deployment processes across all widgets and plugins.
31+
Continuous Integration/Continuous Deployment. 1fe provides standardized pipeline templates through [1fe-ci-cd](https://github.com/docusign/1fe-ci-cd) to ensure consistent building, testing, and deployment processes across all widgets and plugins.
3232

3333
### CDN
3434

3535
Content Delivery Network. A distributed network of servers used to deliver widget assets efficiently. 1fe deployments typically use a CDN to serve widget bundles for optimal performance.
3636

3737
### CLI
3838

39-
Command Line Interface. The `@1fe/cli` package provides the primary tool for building, developing, and validating widgets and plugins in the 1fe ecosystem.
39+
Command Line Interface. The [@1fe/cli](https://www.npmjs.com/package/@1fe/cli) package provides the primary tool for building, developing, and validating widgets and plugins in the 1fe ecosystem.
4040

4141
### Contextual Injection
4242

43-
A mechanism where the `@1fe/shell` package is intercepted at runtime and replaced with platform-specific utilities contextualized to each widget. This enables widgets to access platform utilities without prop drilling.
43+
A mechanism where the [@1fe/shell](https://www.npmjs.com/package/@1fe/shell) package is intercepted at runtime and replaced with platform-specific utilities contextualized to each widget. This enables widgets to access platform utilities without prop drilling.
4444

4545
### Ecosystem
4646

4747
The complete set of packages, repositories, tools, and standards that make up the 1fe platform, including core packages, starter kits, templates, and community widgets.
4848

49-
## Component Types
50-
5149
### Widget
5250

5351
Any packaged JavaScript logic that runs in a browser. Widgets live in their own repositories, control their own release lifecycle, and can be embedded within other widgets or plugins. They follow 1fe standards and are never permitted to be IIFEs (Immediately Invoked Function Expressions).
@@ -60,15 +58,15 @@ A widget that is tied to a specific URL route. Plugins represent full page exper
6058

6159
A widget where the version can be locked to a specific version by the host widget or plugin. If not pinned, the latest version is automatically used.
6260

63-
### Design System Component
61+
### Live Configurations
6462

65-
A simple, atomic presentation component with minimal logic that can be widely reused from a design perspective. These are typically part of a shared design system rather than independent widgets.
63+
Dynamic configuration files that specify widget versions, CDN locations, and deployment status. These enable runtime updates without server restarts.
6664

6765
## 🔧 Technical Components
6866

6967
### Shell
7068

71-
The main application shell provided by `@1fe/shell` that includes common UI components (headers, navigation) and shared platform utilities. The shell is delivered as part of the initial HTML response and provides the foundation for all widget execution.
69+
The main application shell provided by [@1fe/shell](https://www.npmjs.com/package/@1fe/shell) that includes common UI components (headers, navigation) and shared platform utilities. The shell is delivered as part of the initial HTML response and provides the foundation for all widget execution.
7270

7371
### Sandbox
7472

@@ -82,23 +80,15 @@ Props provided by the 1fe platform to widgets, including environment information
8280

8381
Optional props passed from a parent widget to a child widget for integration purposes. These enable feature flags, configuration APIs, and data sharing between widgets.
8482

85-
### Monorepo
86-
87-
A single repository containing multiple related packages. The core 1fe packages are maintained in a monorepo structure for easier development and coordination.
88-
8983
## 🛠️ Development Tools
9084

9185
### 1fe Playground
9286

93-
A special plugin that provides a sandbox environment for developing and testing widgets in isolation during local development. It allows developers to mock platform props and test widget behavior before deployment.
87+
A special plugin that provides a sandbox environment for developing and testing widgets in isolation during local development. It allows developers to mock platform props and test widget behavior before deployment. Available in the [1fe-playground](https://github.com/docusign/1fe-playground) repository.
9488

95-
### Starter Kit
89+
### 1fe Widget Starter Kit
9690

97-
Template repositories (like `1fe-widget-starter-kit`) that provide pre-configured setups for creating new widgets and plugins, including build scripts, CI/CD configurations, and best practices.
98-
99-
### Live Configurations
100-
101-
Dynamic configuration files that specify widget versions, CDN locations, and deployment status. These enable runtime updates without server restarts.
91+
Template repository ([1fe-widget-starter-kit](https://github.com/docusign/1fe-widget-starter-kit)) that provides a template for building widgets within the 1fe ecosystem. This starter kit provides the foundation, examples, and best practices for developing production-ready widgets.
10292

10393
## Development Patterns
10494

@@ -110,10 +100,6 @@ An architectural approach where frontend applications are decomposed into smalle
110100

111101
The import pattern used to access platform utilities: `import { platformProps } from "@1fe/shell"`. This syntax is intercepted and replaced with actual platform utilities at runtime.
112102

113-
### Lazy Loading
114-
115-
The practice of loading widgets on-demand rather than upfront. 1fe automatically lazy-loads all widgets to improve initial page load performance.
116-
117103
### Guest Development
118104

119105
Development work done by teams outside the core platform team. 1fe aims to reduce guest development friction by providing standardized tools and clear boundaries.
@@ -122,19 +108,19 @@ Development work done by teams outside the core platform team. 1fe aims to reduc
122108

123109
### @1fe/cli
124110

125-
The command-line tool for building, developing, and validating widgets. Key commands include `build`, `contracts`, and `dev`.
111+
The command-line tool for building, developing, and validating widgets. Key commands include `build`, `contracts`, and `dev`. Available on [npm](https://www.npmjs.com/package/@1fe/cli) and [GitHub](https://github.com/docusign/1fe/tree/main/packages/cli).
126112

127113
### @1fe/server
128114

129-
The core Express.js server package that provides the runtime backbone for 1fe instances, including configuration polling and asset serving.
115+
The core Express.js server package that provides the runtime backbone for 1fe instances, including configuration polling and asset serving. Available on [npm](https://www.npmjs.com/package/@1fe/server) and [GitHub](https://github.com/docusign/1fe/tree/main/packages/1fe-server).
130116

131117
### @1fe/shell
132118

133-
Provides the application shell, layout components, and shared platform utilities that are available to all widgets at runtime.
119+
Provides the application shell, layout components, and shared platform utilities that are available to all widgets at runtime. Available on [npm](https://www.npmjs.com/package/@1fe/shell) and [GitHub](https://github.com/docusign/1fe/tree/main/packages/1fe-shell).
134120

135-
### create-1fe-app
121+
### @1fe/create-1fe-app
136122

137-
A scaffolding tool for quickly creating new 1fe instances by answering setup questions in the terminal.
123+
A scaffolding tool for quickly creating new 1fe instances by answering setup questions in the terminal. Available on [npm](https://www.npmjs.com/package/@1fe/create-1fe-app) and [GitHub](https://github.com/docusign/1fe/tree/main/packages/create-1fe-app).
138124

139125
---
140126

src/content/docs/tutorials/Developing Your First Widget/getting-started.mdx

Lines changed: 75 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Ensure you have the following installed:
5454
# Check Node.js version (22+ required)
5555
node --version
5656

57-
# Check yarn version
57+
# Check yarn version(4.x.x)
5858
yarn --version
5959
```
6060

@@ -105,84 +105,91 @@ my-first-widget/
105105
This is your main widget component:
106106

107107
```typescript title="src/app1.tsx"
108-
import React, { useEffect } from "react";
109108
import { platformProps } from "@1fe/shell";
109+
import React, { useEffect } from "react";
110+
import { Router as Widget } from "./components/router";
111+
import { withProvider } from "./withProvider";
110112
import { WidgetProps } from "./contract";
111113

112-
const MyWidget: React.FC<WidgetProps> = (props) => {
114+
const RootWrapper: React.FC<WidgetProps> = (props) => {
113115
useEffect(() => {
114-
// Widget initialization
115116
platformProps.utils.appLoadTime.end();
116-
console.log("Hello from my first widget!");
117+
console.log("props", props);
117118
}, []);
118119

119-
return (
120-
<div>
121-
<h1>My First Widget</h1>
122-
<p>Welcome to 1fe widget development!</p>
123-
</div>
124-
);
120+
return <Widget {...props} />;
125121
};
126122

127-
export default MyWidget;
123+
export default withProvider(RootWrapper);
128124
```
129125

130126
### Widget Contract (`src/contract.ts`)
131127

132128
Defines the interface between your widget and the platform:
133129

134130
```typescript title="src/contract.ts"
135-
export interface WidgetProps {
136-
// Define the props your widget expects
137-
title?: string;
138-
theme?: "light" | "dark";
139-
// Add more props as needed
140-
}
131+
import { PlatformPropsType } from "@1fe/shell";
132+
133+
export type HostPropsContract = Record<string, unknown>;
134+
135+
export type WidgetProps = {
136+
host: HostPropsContract;
137+
platform: PlatformPropsType;
138+
};
141139
```
142140

143141
### Configuration (`.1fe.config.ts`)
144142

145143
Controls how your widget is built and deployed:
146144

147145
```typescript title=".1fe.config.ts"
148-
import { defineConfig } from "@1fe/cli";
149-
150-
export default defineConfig({
151-
widget: {
152-
name: "my-first-widget",
153-
entry: "src/app1.tsx",
154-
},
155-
// Additional configuration options
156-
});
146+
import { OneFeConfiguration } from "@1fe/cli";
147+
import { getBaseConfig } from "@1fe/sample-widget-base-config"; // this is the redistributed package for the organization
148+
149+
const configuration: OneFeConfiguration = {
150+
baseConfig: getBaseConfig,
151+
};
152+
153+
export default configuration;
157154
```
158155

159156
## 🚀 Starting the Development Server
160157

158+
:::note[1fe Instance Required]
159+
**Important:** This command requires a running 1fe instance to work properly. If your organization doesn't have a 1fe instance set up yet, you'll need to follow [Tutorial 1: Setup and Deploy a 1fe POC](/tutorials/setup-and-deploy-1fe-poc/) to get your 1fe instance up and running locally first.
160+
:::
161+
161162
Now let's get your widget running locally:
162163

163164
```bash
164165
# Start the development server
165166
yarn dev
166-
167-
# Or with npm
168-
npm run dev
169167
```
170168

171169
You should see output similar to:
172170

173171
```
174-
✓ Widget development server started
175-
✓ Widget bundle available at: http://localhost:8080/js/1fe-bundle.js
176-
✓ Ready for development!
172+
✔ Webpack
173+
Compiled successfully in 3.82s
174+
175+
<i> [webpack-dev-server] Project is running at:
176+
<i> [webpack-dev-server] Loopback: http://127.0.0.1:8080/
177+
<i> [webpack-dev-server] 404s will fallback to '/index.html'
178+
post action hook executed
179+
[dev] Opening the widget in the playground with the URL:
180+
http://localhost:3001/playground?widgetUrl=http%3A%2F%2F127.0.0.1%3A8080%2Fjs%2F1fe-bundle.js
177181
```
178182

179183
**What just happened?**
180184

185+
<div class="prose">
186+
181187
- The 1fe CLI compiled your widget
182188
- Started a local development server
183189
- Made your widget available at a local URL
184190
- Enabled hot reloading for development
185191

192+
</div>
186193
## 🔍 Verifying Your Setup
187194

188195
Let's make sure everything is working:
@@ -197,28 +204,49 @@ http://localhost:8080/js/1fe-bundle.js
197204

198205
You should see JavaScript code (the compiled widget bundle).
199206

200-
### 2. Check Development Logs
207+
### 2. Open in playground
201208

202-
In your terminal, you should see:
209+
If your team doesn't have their own 1fe instance, you can open the widget in our demo 1fe instances playground by visiting:
203210

204-
- No TypeScript errors
205-
- Successful compilation messages
206-
- Hot reload ready status
211+
```
212+
http://demo.1fe.com/playground?widgetUrl=http%3A%2F%2F127.0.0.1%3A8080%2Fjs%2F1fe-bundle.js
213+
```
207214

208215
### 3. Make a Test Change
209216

210217
Edit `src/app1.tsx` and change the heading:
211218

212-
```typescript title="src/app1.tsx" {8}
213-
return (
214-
<div>
215-
<h1>My Awesome First Widget!</h1>
216-
<p>Welcome to 1fe widget development!</p>
217-
</div>
218-
);
219+
```typescript title="src/app1.tsx" {3, 16-21}
220+
import { platformProps } from "@1fe/shell";
221+
import React, { useEffect } from "react";
222+
import { Alert } from "antd";
223+
import { Router as Widget } from "./components/router";
224+
import { withProvider } from "./withProvider";
225+
import { WidgetProps } from "./contract";
226+
227+
const RootWrapper: React.FC<WidgetProps> = (props) => {
228+
useEffect(() => {
229+
platformProps.utils.appLoadTime.end();
230+
console.log("Widget loaded with props:", props);
231+
}, [props]);
232+
233+
return (
234+
<div>
235+
<Alert
236+
message="🎉 Widget Ready!"
237+
type="success"
238+
style={{ margin: "8px" }}
239+
closable
240+
/>
241+
<Widget {...props} />
242+
</div>
243+
);
244+
};
245+
246+
export default withProvider(RootWrapper);
219247
```
220248

221-
Save the file and watch your terminal - you should see the widget recompile automatically.
249+
Save the file and watch your terminal - you should see the widget recompile automatically and your browser should show a pretty banner at the top of the page with a close button.
222250

223251
## 📁 Understanding Widget Architecture
224252

@@ -244,20 +272,6 @@ The typical development cycle is:
244272
3. **Build** - Compile with `yarn build:widget`
245273
4. **Deploy** - Push to your organization's deployment pipeline
246274

247-
## ✅ Validation Checklist
248-
249-
Before moving to the next step, ensure:
250-
251-
<div class="prose">
252-
253-
- [ ] **Node.js 18+** installed and working
254-
- [ ] **Widget starter kit** cloned and dependencies installed
255-
- [ ] **Development server** running without errors
256-
- [ ] **Bundle URL** accessible at http://localhost:8080/js/1fe-bundle.js
257-
- [ ] **Hot reloading** working when you make code changes
258-
259-
</div>
260-
261275
## 🎉 Success!
262276

263277
Congratulations! You now have a fully functional widget development environment. Your widget is compiled, served locally, and ready for development.
@@ -268,10 +282,6 @@ Now that your development environment is ready, let's learn how to use the 1fe P
268282

269283
**[Step 2: Using the Playground for Development](/tutorials/developing-your-first-widget/using-playground/)**
270284

271-
In the next step, you'll load your widget in the playground and start the interactive development workflow.
285+
In the next step, we will explore the playground to learn more of it's features.
272286

273287
---
274-
275-
:::tip[Organization Integration]
276-
Once you're comfortable with this standard workflow, ask your platform team about organization-specific development tools. The concepts you're learning here apply to any custom tooling your organization provides!
277-
:::

0 commit comments

Comments
 (0)