Skip to content

Dev Console Aliases - #3841

Draft
jameszhang244 wants to merge 20 commits into
mainfrom
jzhang/dev-console-aliases
Draft

Dev Console Aliases#3841
jameszhang244 wants to merge 20 commits into
mainfrom
jzhang/dev-console-aliases

Conversation

@jameszhang244

@jameszhang244 jameszhang244 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

Adds @osdk/aliases, a new package holding the alias runtime, and a browser-safe entry point so Developer Console apps can read installer-supplied configuration.

Why

Custom aliases let an app author declare env-var-style config that a Marketplace installer fills in at install time. Two problems with hosting that in @osdk/functions:

  1. @osdk/functions peer-depends on @osdk/client, so a browser app reading a JSON file inherited a client version floor. This failed npm install in a Developer Console app's build with ERESOLVE.
  2. Aliases are meant to span Functions, transforms, Slate, and Developer Console. Living inside one runtime's package misrepresents that.

@osdk/aliases has no dependencies on @osdk/client or @osdk/functions, so neither problem can recur by construction.

Public API

import { Aliases } from "@osdk/aliases/experimental";

const aliases = await Aliases.load();
const apiBaseUrl = aliases.custom("apiBaseUrl");

Aliases.load() may be called once in main.tsx for application-wide loading or only where aliases are needed. Repeated and concurrent calls share the cached load and return the same reader. Once loaded, custom() is a synchronous lookup. The reader shape also leaves room for additional alias namespaces later.

Node code (Functions) keeps using the filesystem runtime, unchanged:

import { Aliases } from "@osdk/functions"; // or "@osdk/aliases/node"
Aliases.custom("myAlias");

Entry points:

Path Contents Stability
. nothing reserved for the stable API
./experimental browser runtime provisional
./node filesystem runtime unchanged, not experimental

The browser API sits behind experimental so the import path states its stability at every call site, matching @osdk/client, @osdk/react, and @osdk/react-components.

Resolution behavior

Aliases.load() fetches and caches aliases before returning a synchronous reader. Loading is explicit because browsers cannot perform a synchronous network read. Applications decide where to handle the initial loading and any error; a future React hook can wrap the same API without changing the underlying behavior.

Two files can supply values:

Source Carries When
.palantir/deployment.config.json installer's resolved values Marketplace-installed site
public/resources.json author's declared defaults local dev, or deployed without Marketplace

Callers do not choose between them. The deployment config is tried first. The declaration file is used only when the deployment config appears absent: a 404 or a 200 containing an HTML document, as single-page-app hosts may rewrite unknown paths to index.html. Any other failure throws instead of silently substituting the author's defaults for the installer's values.

Compatibility

@osdk/functions re-exports the Node runtime through a local facade at src/aliases/index.ts, so its public Aliases namespace is unchanged. The facade uses explicit named re-exports to accommodate API Extractor.

etc/functions.report.api.md is updated to reflect that the namespace members now resolve from @osdk/aliases/node.

Testing

pnpm turbo test           --filter=@osdk/aliases     # 100 tests
pnpm turbo typecheck      --filter=@osdk/aliases --filter=@osdk/functions
pnpm turbo transpileTypes --filter=@osdk/aliases --filter=@osdk/functions
pnpm turbo check-api      --filter=@osdk/functions
pnpm --dir packages/aliases lint
npx mrl check

transpileTypes is listed separately because typecheck runs with --emitDeclarationOnly false and does not exercise --isolatedDeclarations; declaration-emit errors can therefore pass typecheck and still fail the build.

The browser tests cover successful loading and lookup, concurrent and repeated loads, cache reset and retry, missing aliases, malformed responses, value validation, deployment/default fallback behavior, inherited JavaScript property names, and the experimental export boundary.

Verified end to end against a Foundry stack:

  • Declared two aliases in an app's public/resources.json, deployed the site, packaged it as a Marketplace product, and installed it with overrides. The running site reads the installer's values rather than the declared defaults.
  • Upgraded the installation to a new product version. The installer's values persist, which is why the alias input-shape ID excludes the application version.

Packaging an application with no aliases is covered by unit tests but has not yet been verified end to end.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size Change
@osdk/api 432 B 0%
@osdk/client 30.10 kB -0.06% 🔽
@osdk/client/experimental 30.69 kB -0.05% 🔽
@osdk/client/observable 57.13 kB +0.04% 🔺
@osdk/oauth 6.54 kB 0%
@osdk/react 60.99 kB -0.14% 🔽
@osdk/react/devtools-registry 184 B 0%
@osdk/react/experimental 60.99 kB -0.01% 🔽
@osdk/react/platform-apis 4.07 kB 0%
@osdk/react/testing 536 B 0%
@osdk/react/experimental/admin 4.07 kB 0%
@osdk/react/experimental/aip 5.21 kB 0%
@osdk/react-components 10 B 0%
@osdk/react-components/experimental 707.14 kB 0%
@osdk/react-components/primitives 40.64 kB 0%
@osdk/react-components/experimental/action-form 277.55 kB 0%
@osdk/react-components/experimental/aip-agent-chat 16.45 kB 0%
@osdk/react-components/experimental/cbac-picker 54.23 kB 0%
@osdk/react-components/experimental/document-viewer 346.74 kB 0%
@osdk/react-components/experimental/email-viewer 21.89 kB 0%
@osdk/react-components/experimental/filter-list 132.09 kB 0%
@osdk/react-components/experimental/image-viewer 3.72 kB 0%
@osdk/react-components/experimental/markdown-renderer 44.21 kB 0%
@osdk/react-components/experimental/object-table 162.84 kB 0%
@osdk/react-components/experimental/pdf-viewer 160.40 kB 0%
@osdk/react-components/experimental/spreadsheet-viewer 106.23 kB 0%
@osdk/react-components/experimental/theme 714 B 0%
@osdk/react-components/experimental/tiff-renderer 29.59 kB 0%
@osdk/react-components/experimental/video-viewer 3.75 kB 0%
@osdk/react-components/experimental/xml-viewer 3.73 kB 0%
@osdk/widget.client-react 12.39 kB 0%

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Storybook Preview

📚 Open Storybook preview

Built from commit 856e889.
Workflow run

github-actions Bot added a commit that referenced this pull request Aug 12, 2026
github-actions Bot added a commit that referenced this pull request Aug 12, 2026
github-actions Bot added a commit that referenced this pull request Aug 12, 2026
github-actions Bot added a commit that referenced this pull request Aug 17, 2026
@jameszhang244
jameszhang244 force-pushed the jzhang/dev-console-aliases branch from eddc41b to 4036f75 Compare August 17, 2026 21:08
github-actions Bot added a commit that referenced this pull request Aug 17, 2026
github-actions Bot added a commit that referenced this pull request Aug 17, 2026
@jameszhang244
jameszhang244 force-pushed the jzhang/dev-console-aliases branch from 1f2c995 to 892007b Compare August 17, 2026 21:36
github-actions Bot added a commit that referenced this pull request Aug 17, 2026
github-actions Bot added a commit that referenced this pull request Aug 17, 2026
github-actions Bot added a commit that referenced this pull request Aug 18, 2026
github-actions Bot added a commit that referenced this pull request Aug 18, 2026
@jameszhang244
jameszhang244 force-pushed the jzhang/dev-console-aliases branch from 7b37e6a to 163d1ab Compare August 19, 2026 16:18
github-actions Bot added a commit that referenced this pull request Aug 19, 2026
github-actions Bot added a commit that referenced this pull request Aug 19, 2026
@jameszhang244
jameszhang244 force-pushed the jzhang/dev-console-aliases branch from e5da7bc to 21fb8e7 Compare August 20, 2026 20:12
github-actions Bot added a commit that referenced this pull request Aug 20, 2026
github-actions Bot added a commit that referenced this pull request Aug 20, 2026
github-actions Bot added a commit that referenced this pull request Aug 20, 2026
github-actions Bot added a commit that referenced this pull request Aug 20, 2026
github-actions Bot added a commit that referenced this pull request Aug 21, 2026
github-actions Bot added a commit that referenced this pull request Aug 25, 2026
@jameszhang244
jameszhang244 force-pushed the jzhang/dev-console-aliases branch from 91de652 to a35139b Compare August 25, 2026 17:10
@jameszhang244
jameszhang244 force-pushed the jzhang/dev-console-aliases branch from a35139b to 8d16795 Compare August 25, 2026 17:11
github-actions Bot added a commit that referenced this pull request Aug 25, 2026
github-actions Bot added a commit that referenced this pull request Aug 25, 2026
github-actions Bot added a commit that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant