Skip to content

Commit ebdbe9a

Browse files
itsdougestriplex-bot
authored andcommitted
Triplex for VS Code Announcement Blog
adeira-source-id: 10eed64
1 parent fcf6ee6 commit ebdbe9a

16 files changed

Lines changed: 239 additions & 35 deletions

File tree

apps/docs/components/landing-video.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* see this files license find the nearest LICENSE file up the source tree.
66
*/
77

8+
import { LoadingLogo } from "@triplex/lib/loader";
89
import { useLayoutEffect, useRef, useState } from "react";
910
import { InlineVideo } from "./video";
1011

@@ -46,10 +47,19 @@ export function LandingVideo() {
4647
if (isExpanded) {
4748
return (
4849
<dialog
49-
className="border-neutral bg-surface backdrop:bg-surface m-auto aspect-video h-auto w-11/12 border backdrop:opacity-80 focus-visible:outline-none md:max-w-5xl"
50+
className="border-neutral text-default bg-surface backdrop:bg-surface m-auto box-content aspect-video h-auto w-11/12 border backdrop:opacity-80 focus-visible:outline-none md:max-w-5xl"
5051
ref={ref}
5152
>
52-
<div className="absolute inset-0"></div>
53+
<LoadingLogo position="splash" variant="stroke" />
54+
<iframe
55+
allow="autoplay; encrypted-media; picture-in-picture; web-share"
56+
allowFullScreen
57+
className="relative z-10 h-full w-full"
58+
frameBorder="0"
59+
referrerPolicy="strict-origin-when-cross-origin"
60+
src="https://www.youtube.com/embed/XEvvJ5Siff8?si=Gnb2XDKIZQXtN4Zq&cc_load_policy=1&cc_lang_pref=en"
61+
width="100%"
62+
/>
5363
</dialog>
5464
);
5565
}

apps/docs/next.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export default withNextra({
6060
source: "/docs/faq",
6161
},
6262
],
63+
transpilePackages: ["@triplex/lib"],
6364
typescript: {
6465
ignoreBuildErrors: true,
6566
},

apps/docs/nextra-triplex/layout.tsx

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ export function Layout({ children, pageOpts }: NextraThemeLayoutProps) {
114114

115115
return false;
116116
});
117-
const hasPageAuthorOrDate = frontMatter.date || frontMatter.author;
117+
const hasPageAuthorOrDate = !!frontMatter.date || !!frontMatter.author;
118+
const authorSocials =
119+
frontMatter.author in socials
120+
? socials[frontMatter.author as keyof typeof socials]
121+
: undefined;
118122

119123
useEffect(() => {
120124
setNavOpen(false);
@@ -196,30 +200,36 @@ export function Layout({ children, pageOpts }: NextraThemeLayoutProps) {
196200
variant="lines"
197201
>
198202
{hasPageAuthorOrDate && (
199-
<div className="space-x-1">
200-
{frontMatter.date && (
201-
<time className="text-subtlest" dateTime={frontMatter.date}>
202-
{friendlyDate(frontMatter.date)}
203-
</time>
204-
)}
205-
{frontMatter.author && frontMatter.date && (
206-
<span className="text-subtlest"> · </span>
207-
)}
208-
{frontMatter.author && (
203+
<div className="flex flex-wrap items-center gap-x-2">
204+
{authorSocials && (
209205
<a
210-
className="hover:text-default text-subtlest underline"
211-
href={
212-
frontMatter.author in socials
213-
? socials[frontMatter.author as keyof typeof socials]
214-
.url
215-
: "#"
216-
}
206+
className="hover:text-default text-subtlest flex items-center gap-0.5 text-base underline"
207+
href={authorSocials.url || "#"}
217208
rel="noreferrer"
218209
target="_blank"
219210
>
211+
<Image
212+
alt=""
213+
className="bg-neutral border-neutral mr-1 h-6 w-6 rounded-full border"
214+
height={20}
215+
src={authorSocials.avatar}
216+
width={20}
217+
/>
220218
{frontMatter.author}
221219
</a>
222220
)}
221+
{frontMatter.author && frontMatter.date && (
222+
<span className="text-subtlest text-base"> · </span>
223+
)}
224+
{frontMatter.date && (
225+
<time
226+
className="text-subtlest text-base"
227+
dateTime={frontMatter.date}
228+
title={frontMatter.date}
229+
>
230+
{friendlyDate(frontMatter.date)}
231+
</time>
232+
)}
223233
</div>
224234
)}
225235
{!hasPageAuthorOrDate && result.activeThemeContext.breadcrumb && (
@@ -241,7 +251,7 @@ export function Layout({ children, pageOpts }: NextraThemeLayoutProps) {
241251
)}
242252
</div>
243253
)}
244-
<h1 className="text-default font-brand flex flex-wrap items-center gap-2 text-3xl font-semibold lg:text-4xl">
254+
<h1 className="text-default font-brand flex flex-wrap items-center gap-2 text-3xl font-medium lg:text-4xl lg:font-semibold">
245255
{title}
246256
{frontMatter.app && (
247257
<div

apps/docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@radix-ui/react-icons": "^1.3.0",
1616
"@react-three/drei": "^10.0.0",
1717
"@react-three/fiber": "^9.0.4",
18+
"@triplex/lib": "0.69.11",
1819
"@types/cors": "^2.8.17",
1920
"@types/flexsearch": "^0.7.6",
2021
"@types/raf-schd": "^4.0.3",

apps/docs/pages/api/og.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function fetchAssets() {
3434

3535
function parseTitle(paramTitle: string | null) {
3636
const title = paramTitle || "Triplex IDE";
37-
const slicedTitle = title.slice(0, 40);
37+
const slicedTitle = title.slice(0, 56);
3838

3939
if (title !== slicedTitle) {
4040
return slicedTitle + "...";
@@ -72,10 +72,10 @@ export default async function (request: Request) {
7272
borderRadius: "3333px",
7373
display: "flex",
7474
height: "4.5rem",
75-
left: "2rem",
75+
left: "3rem",
7676
padding: "0.85rem 2rem 0.75rem",
7777
position: "absolute",
78-
top: "2rem",
78+
top: "3rem",
7979
}}
8080
>
8181
<img src={workmark} style={{ height: "100%" }} />
@@ -100,7 +100,7 @@ export default async function (request: Request) {
100100
<div
101101
style={{
102102
display: "flex",
103-
height: "28%",
103+
height: "18%",
104104
marginTop: "2rem",
105105
paddingLeft: "4rem",
106106
paddingRight: "4rem",

apps/docs/pages/blog/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"*": {
33
"theme": {
44
"layout": "full",
5-
"pagination": false
5+
"pagination": false,
6+
"feedback": true
67
}
78
},
89
"triplex-for-vscode": "",
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
author: Michael Dougall
3+
title: Supercharging the "Visual" in Visual Studio Code
4+
date: 2025-03-25 GMT+1100
5+
description: After almost a year of development Triplex for VS Code is now available in public beta with exciting features coming later this year.
6+
image: /ui/vsce-release.png
7+
imageLayout: cover
8+
---
9+
10+
Triplex for VS Code is now in public beta! Thank you to everyone who has used it, provided feedback, and raised issues up until now! It wouldn't have been the same without you. In a rush? Install it from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=trytriplex.triplex-vsce).
11+
12+
Continue reading to learn more about the journey to get here, some open source announcements, and what's next.
13+
14+
## The Initial Release
15+
16+
Triplex was originally released as a standalone app promising to eliminate the friction of developing in 3D and lowering the barrier of entry for coders and non-coders alike. Positioning objects, lights, and cameras was never easier thanks to its visual controls and code-sync features. Before you'd jump in-and-out of your code editor and browser to see if the changes to your React component were correct, instead with Triplex you'd just make the change visually or with input controls then save straight back to code.
17+
18+
But there was a problem.
19+
20+
### Where Is Everyone?
21+
22+
While there was a lot of excitement around Triplex the reality is coders just don't want to use another tool on-top of their code editor and browser. There was a possible future where Triplex could integrate a code editor into the standalone app but that's a lot of work while still not getting to the root of the problem, coders like their own code editors!
23+
24+
So there was a decision to be made: do I double down on Triplex Standalone and focus on non-coders, or do something else for coders? I'm just one guy and I don't have infinite time or resources, so narrowing down on a target audience needed to happen. I've made the bet on coders. The underlying tech is code, and they'll be the ones who would bring it to their teams if they find it useful. That's not to say I'm alienating non-coders, just that there's a focus on coders for now.
25+
26+
So instead of trying to convince coders to move from what they're used to we augment their existing workflow.
27+
28+
## Introducing Triplex for VS Code
29+
30+
Triplex for VS Code turns [Visual Studio Code](https://code.visualstudio.com), [Cursor](https://cursor.com), [Windsurf](https://codeium.com/windsurf), and all other VS Code forks into your visual workspace. Keep using your favorite features like GitHub Copilot and IntelliSense while having the power of Triplex at your fingertips.
31+
32+
Any React component can now be opened in Triplex with a single click where it's loaded and ready to be inspected, manipulated, and saved back to code. No more jumping between tools to see if your changes are correct.
33+
34+
Install it from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=trytriplex.triplex-vsce).
35+
36+
## The Road To Release
37+
38+
Throughout the year I've been constantly reminded that nothing is ever easy. There were a load of challenges to overcome and that's not even talking about the complexities of creating and working on a VS Code extension!
39+
40+
Let's talk about some.
41+
42+
### Moving Beyond React Three Fiber
43+
44+
The big one. Triplex was originally made for React Three Fiber, so the second you bring in something that expects a React DOM environment it blew up.
45+
46+
Take this component that renders its own Canvas:
47+
48+
```jsx
49+
import { Canvas } from "@react-three/fiber";
50+
51+
export default function App() {
52+
return (
53+
<Canvas>
54+
<mesh>
55+
<boxGeometry />
56+
</mesh>
57+
</Canvas>
58+
);
59+
}
60+
```
61+
62+
...It wouldn't work! This was a common source of confusion when working with Triplex and the reality was folks would run into this, assume the tool was broken, and then jump out.
63+
64+
I'm pumped to announce that Triplex can now open any React component, 2D or 3D. This is a big ecosystem win and a huge step forward in making Triplex more accessible.
65+
66+
Want to learn more about how this was achieved? I spoke about it recently, watch it below (it's a bit technical, sorry!).
67+
68+
<iframe
69+
width="100%"
70+
className="mt-7 aspect-video"
71+
src="https://www.youtube.com/embed/nkq-gNMSDLs?si=A5bRBW6Kxv0d_z5G"
72+
frameBorder="0"
73+
allow="autoplay; encrypted-media; picture-in-picture; web-share"
74+
referrerPolicy="strict-origin-when-cross-origin"
75+
allowFullScreen
76+
/>
77+
78+
Watch out for further blog posts that dive into how the React DOM and React Three Fiber reconcilers work together in Triplex. I'm especially proud of the selection system.
79+
80+
### Removing User Friction
81+
82+
Intentional or not the early Triplex put up a few barriers that would either stop you from working on a component or not work well with other tools. Things like:
83+
84+
- Needing to add a Triplex config to get started
85+
- A `tsconfig.json` file being generated for JavaScript projects, breaking Next.js builds
86+
- If you were missing dependencies you'd get into an unhelpful, cryptic error state
87+
- If you had a syntax error Triplex would go into an unrecoverable state
88+
89+
These and more have all been resolved. The shortest path for opening a component in Triplex for VS Code now is: install the extension, find a component, and open it.
90+
91+
It's a good day to be a React component!
92+
93+
## Open Sourcing Websocks
94+
95+
On the road to release I open sourced [Websocks](https://github.com/trytriplex/websocks), an end-to-end typed websocket server for Node.js with clients for React and events, powering all of the data you see through the Triplex UI.
96+
97+
Here's the smallest usage example:
98+
99+
```tsx filename="server.ts"
100+
// 1. Create the websocks server
101+
import { createWSServer } from "@triplex/websocks-server";
102+
103+
const wss = createWSServer();
104+
105+
// 2. Define routes
106+
const routes = wss.collectTypes([
107+
wss.route(
108+
"/rng/:max",
109+
({ max }) => Math.round(Math.random() * Number(max)),
110+
(push) => {
111+
setInterval(() => {
112+
// Every 1s push a new value to the client.
113+
push();
114+
}, 1000);
115+
},
116+
),
117+
]);
118+
119+
// 3. Export types to use with the client
120+
export type Routes = typeof routes;
121+
```
122+
123+
```tsx filename="client.tsx"
124+
// 1. Import the server types
125+
import { createWSHooks } from "@triplex/websocks-client/react";
126+
import { type Routes } from "./server";
127+
128+
// 2. Declare the clients
129+
const { useLazySubscription } = createWSHooks<Routes>({
130+
url: "ws://localhost:3000",
131+
});
132+
133+
// 3. Subscribe to data
134+
function Component() {
135+
const value = useLazySubscription("/rng/:max", { max: 100 });
136+
return <div>{value}</div>;
137+
}
138+
```
139+
140+
It has been a game changer for doing sweeping refactors across the Triplex codebase with confidence. I hope you find it useful in your projects too!
141+
142+
## Open Sourcing the Core
143+
144+
Continuing our open source story I'm excited to announce that the core Triplex renderer is now open source and available in the [Triplex repository](https://github.com/trytriplex/triplex). It's responsible for the scene and visual controls you use in both Triplex for VS Code and Triplex Standalone!
145+
146+
Some areas of interest are:
147+
148+
- [The selection system](https://github.com/trytriplex/triplex/blob/main/packages/renderer/src/features/selection-provider/use-selection-marhsal.tsx)
149+
- [The component loaders](https://github.com/trytriplex/triplex/blob/main/packages/renderer/src/features/scene-loader/index.tsx); and
150+
- [The scene element component](https://github.com/trytriplex/triplex/blob/main/packages/renderer/src/features/scene-element/index.tsx)
151+
152+
Share the love! Star the repositories and think about contributing a bug fix or new feature. You can find issues that can be picked up labelled with [ready for contribution](https://github.com/trytriplex/triplex/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Contribution%20ready%22) and I can chat with you on [Discord](https://discord.gg/nBzRBUEs4b) to help get you started.
153+
154+
It takes a village, and I'd love for you to be part of it.
155+
156+
## What's Next
157+
158+
This is just the beginning. [Install the extension](https://marketplace.visualstudio.com/items?itemName=trytriplex.triplex-vsce), [join the community](https://discord.gg/nBzRBUEs4b), and let's build! If you've found bugs or want to suggest a feature you can [raise an issue on GitHub](https://github.com/trytriplex/triplex/issues).
159+
160+
In the coming months we'll be focusing on three primary areas:
161+
162+
1. Exploring AI
163+
1. Ecosystem Plugins; and
164+
1. Team Collaboration
165+
166+
Have thoughts or opinions for any of the above? [Let us know on Discord](https://discord.gg/nBzRBUEs4b). Thanks again to everyone that has been part of the journey so far, I can't wait to see where we go next!

apps/docs/pages/docs/get-started/standalone.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ image: /ui/standalone-app.png
66

77
import { DashboardIcon } from "@radix-ui/react-icons";
88

9-
Triplex Standalone is the desktop version of Triplex for macOS, Windows, and Linux.
10-
119
## Installation
1210

1311
1. Visit the [Download page](/download)

apps/docs/pages/docs/get-started/vscode.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Turn Visual Studio Code, Cursor, Windsurf, and forks into your visu
44
image: /ui/vsce-app-dark.png
55
---
66

7-
Triplex for VS Code turns [Visual Studio Code](https://code.visualstudio.com), [Cursor](https://www.cursor.com), [Windsurf](https://codeium.com/windsurf), and other forks into your visual workspace, bringing the best features of Triplex for you to stay in context while coding.
8-
97
## Installation
108

119
1. Visit the [Visual Studio Code marketplace](https://marketplace.visualstudio.com/items?itemName=trytriplex.triplex-vsce)
38.9 KB
Loading

0 commit comments

Comments
 (0)