Skip to content

Commit

Permalink
Rename install() to use() (#29359)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 45231b104168569e9ad5123ce9357b0cece0d92e
  • Loading branch information
sujayakar authored and Convex, Inc. committed Aug 30, 2024
1 parent dcefdc7 commit 036e1b3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion npm-packages/component-tests/envVars/convex.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineComponent } from "convex/server";
import { default as otherComponent } from "../component/convex.config";

const component = defineComponent("envVars");
component.install(otherComponent, {
component.use(otherComponent, {
name: "component",
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import errors from "../../../errors/convex.config";
// @ts-ignore
const app = defineApp();

app.install(errors);
app.install(envVars);
app.use(errors);
app.use(envVars);

export default app;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import envVars from "../../../envVars/convex.config";
// @ts-ignore
const app = defineApp();

app.install(component);
app.install(envVars);
app.use(component);
app.use(envVars);

export default app;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import component from "../../../component/convex.config";
// @ts-ignore
const app = defineApp();

app.install(component);
app.use(component);

export default app;
10 changes: 5 additions & 5 deletions npm-packages/convex/src/server/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type ComponentDefinition<Exports extends ComponentExports = any> = {
* For editor tooling this method expects a {@link ComponentDefinition}
* but at runtime the object that is imported will be a {@link ImportedComponentDefinition}
*/
install<Definition extends ComponentDefinition<any>>(
use<Definition extends ComponentDefinition<any>>(
definition: Definition,
options?: {
name?: string;
Expand Down Expand Up @@ -106,7 +106,7 @@ export type AppDefinition = {
* For editor tooling this method expects a {@link ComponentDefinition}
* but at runtime the object that is imported will be a {@link ImportedComponentDefinition}
*/
install<Definition extends ComponentDefinition<any>>(
use<Definition extends ComponentDefinition<any>>(
definition: Definition,
options?: {
name?: string;
Expand Down Expand Up @@ -186,7 +186,7 @@ function createExports(name: string, pathParts: string[]): any {
return new Proxy({}, handler);
}

function install<Definition extends ComponentDefinition<any>>(
function use<Definition extends ComponentDefinition<any>>(
this: CommonDefinitionData,
definition: Definition,
options?: {
Expand Down Expand Up @@ -336,7 +336,7 @@ export function defineComponent<Exports extends ComponentExports = any>(
_onInitCallbacks: {},

export: exportComponentForAnalysis,
install,
use,

// pretend to conform to ComponentDefinition, which temporarily expects __args
...({} as { __args: any; __exports: any }),
Expand All @@ -355,7 +355,7 @@ export function defineApp(): AppDefinition {
_exportTree: {},

export: exportAppForAnalysis,
install,
use,
};
return ret as AppDefinition;
}
Expand Down

0 comments on commit 036e1b3

Please sign in to comment.