@samitouri / QOS-React-2 / commits / 870a378ebb

[be] Rename EnvironmentConfig type after refactor

Joe Savona committed Oct 3, 2023 at 15:01 UTC 870a378ebbb48b5572a6b2abf6b6a3d35a0d6c6f
1 file changed +6 -6
compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts
+6 -6
@@ -85,7 +85,7 @@ export type Hook = {
85 // missing required shapes (BuiltInArray for [] and BuiltInObject for {})
86 // missing some recursive Object / Function shapeIds
87
88 -export type CompleteEnvironmentConfig = {
88 +export type EnvironmentConfig = {
89 customHooks: Map<string, Hook> | null;
90
91 // 🌲
@@ -246,7 +246,7 @@ export type CompleteEnvironmentConfig = {
246 bailoutOnHoleyArrays: boolean;
247 };
248
249 -const DEFAULT_ENVIRONMENT_CONFIG: CompleteEnvironmentConfig = {
249 +const DEFAULT_ENVIRONMENT_CONFIG: EnvironmentConfig = {
250 customHooks: null,
251
252 enableTreatHooksAsFunctions: true,
@@ -269,14 +269,14 @@ const DEFAULT_ENVIRONMENT_CONFIG: CompleteEnvironmentConfig = {
269 validateRefAccessDuringRender: false,
270 };
271
272 -export type PartialEnvironmentConfig = Partial<CompleteEnvironmentConfig>;
272 +export type PartialEnvironmentConfig = Partial<EnvironmentConfig>;
273
274 export class Environment {
275 #globals: GlobalRegistry;
276 #shapes: ShapeRegistry;
277 #nextIdentifer: number = 0;
278 #nextBlock: number = 0;
279 - config: CompleteEnvironmentConfig;
279 + config: EnvironmentConfig;
280
281 #contextIdentifiers: Set<t.Identifier>;
282 #hoistedIdentifiers: Set<t.Identifier>;
@@ -286,9 +286,9 @@ export class Environment {
286 contextIdentifiers: Set<t.Identifier>
287 ) {
288 this.#shapes = new Map(DEFAULT_SHAPES);
289 - const config: CompleteEnvironmentConfig = { ...DEFAULT_ENVIRONMENT_CONFIG };
289 + const config: EnvironmentConfig = { ...DEFAULT_ENVIRONMENT_CONFIG };
290 for (const rawKey in DEFAULT_ENVIRONMENT_CONFIG) {
291 - const key = rawKey as keyof CompleteEnvironmentConfig;
291 + const key = rawKey as keyof EnvironmentConfig;
292 const value = partialConfig?.[key] ?? DEFAULT_ENVIRONMENT_CONFIG[key];
293 config[key] = value as any;
294 }