@rbxts/app-forge 0.6.0-alpha.14 → 0.6.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,28 +3,10 @@ local TS = _G[script]
3
3
  -- Services
4
4
  local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
5
5
  -- Packages
6
- local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
7
- local useBinding = _react.useBinding
8
- local createElement = _react.createElement
6
+ local createElement = TS.import(script, TS.getModule(script, "@rbxts", "react")).createElement
9
7
  -- Types
10
8
  -- Components
11
9
  local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
12
- local function createBinding(name, manager)
13
- local _name = name
14
- local app = AppRegistry[_name]
15
- if not app then
16
- error(`App "{name}" not registered`)
17
- end
18
- local _condition = app.visible
19
- if _condition == nil then
20
- _condition = false
21
- end
22
- local binding = { useBinding(_condition) }
23
- local _binds = manager.binds
24
- local _name_1 = name
25
- _binds[_name_1] = binding
26
- return unpack(binding)
27
- end
28
10
  local function createInstance(props)
29
11
  local _binding = props
30
12
  local name = _binding.name
@@ -52,11 +34,9 @@ end
52
34
  local function AppContainer(props)
53
35
  local _binding = props
54
36
  local name = _binding.name
55
- local forge = _binding.forge
56
37
  if not (name ~= "" and name) then
57
38
  error("App name is required in AppContainer")
58
39
  end
59
- createBinding(name, forge)
60
40
  local element = createInstance(props)
61
41
  if not element then
62
42
  error(`Failed to create instance for app "{name}"`)
@@ -1,3 +1,3 @@
1
1
  import React from "@rbxts/react";
2
- import Types from "./types";
2
+ import type Types from "./types";
3
3
  export declare function Render(props: Types.NameProps & Types.MainProps): React.ReactNode;
@@ -1,9 +1,38 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ -- Packages
4
+ local useBinding = TS.import(script, TS.getModule(script, "@rbxts", "react")).useBinding
2
5
  -- Types
6
+ -- Components
7
+ local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
8
+ local function createBinding(name, manager)
9
+ local _name = name
10
+ local app = AppRegistry[_name]
11
+ if not app then
12
+ error(`App "{name}" not registered`)
13
+ end
14
+ local _condition = app.visible
15
+ if _condition == nil then
16
+ _condition = false
17
+ end
18
+ local binding = { useBinding(_condition) }
19
+ local _binds = manager.binds
20
+ local _name_1 = name
21
+ _binds[_name_1] = binding
22
+ return unpack(binding)
23
+ end
3
24
  local function Render(props)
4
25
  local names = props.names
5
26
  local name = props.name
6
27
  local forge = props.forge
28
+ -- ▼ ReadonlyMap.forEach ▼
29
+ local _callback = function(_, name)
30
+ return createBinding(name, forge)
31
+ end
32
+ for _k, _v in AppRegistry do
33
+ _callback(_v, _k, AppRegistry)
34
+ end
35
+ -- ▲ ReadonlyMap.forEach ▲
7
36
  if name ~= "" and name then
8
37
  return forge:renderApp(props)
9
38
  elseif names then
@@ -3,34 +3,11 @@ local TS = _G[script]
3
3
  -- Services
4
4
  local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
5
5
  -- Packages
6
- local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
7
- local vide = _vide
8
- local source = _vide.source
6
+ local vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
9
7
  -- Types
10
8
  -- Components
11
9
  local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
12
10
  local create = vide.create
13
- local function createSource(name, forge)
14
- local _name = name
15
- local app = AppRegistry[_name]
16
- if not app then
17
- error(`App "{name}" not registered`)
18
- end
19
- local _sources = forge.sources
20
- local _name_1 = name
21
- if _sources[_name_1] ~= nil then
22
- return nil
23
- end
24
- local _sources_1 = forge.sources
25
- local _exp = name
26
- local _condition = app.visible
27
- if _condition == nil then
28
- _condition = false
29
- end
30
- local _arg1 = source(_condition)
31
- _sources_1[_exp] = _arg1
32
- return source
33
- end
34
11
  local function createInstance(props)
35
12
  local _binding = props
36
13
  local name = _binding.name
@@ -53,11 +30,9 @@ end
53
30
  local function AppContainer(props)
54
31
  local _binding = props
55
32
  local name = _binding.name
56
- local forge = _binding.forge
57
33
  if not (name ~= "" and name) then
58
34
  error("App name is required in AppContainer")
59
35
  end
60
- createSource(name, forge)
61
36
  local element = createInstance(props)
62
37
  if not element then
63
38
  error(`Failed to create instance for app "{name}"`)
@@ -1,3 +1,3 @@
1
1
  import Vide from "@rbxts/vide";
2
- import Types from "./types";
2
+ import type Types from "./types";
3
3
  export declare function Render(props: Types.NameProps & Types.MainProps): Vide.Node;
@@ -2,14 +2,46 @@
2
2
  local TS = _G[script]
3
3
  -- Packages
4
4
  local usePx = TS.import(script, TS.getModule(script, "@rbxts", "loners-pretty-vide-utils").out).usePx
5
+ local source = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).source
5
6
  -- Types
7
+ -- Components
8
+ local AppRegistry = TS.import(script, script.Parent, "decorator").AppRegistry
6
9
  local __px = false
10
+ local function createSource(name, forge)
11
+ local _name = name
12
+ local app = AppRegistry[_name]
13
+ if not app then
14
+ error(`App "{name}" not registered`)
15
+ end
16
+ local _sources = forge.sources
17
+ local _name_1 = name
18
+ if _sources[_name_1] ~= nil then
19
+ return nil
20
+ end
21
+ local _sources_1 = forge.sources
22
+ local _exp = name
23
+ local _condition = app.visible
24
+ if _condition == nil then
25
+ _condition = false
26
+ end
27
+ local _arg1 = source(_condition)
28
+ _sources_1[_exp] = _arg1
29
+ return source
30
+ end
7
31
  local function Render(props)
8
32
  local _binding = props
9
33
  local config = _binding.config
10
34
  local name = _binding.name
11
35
  local names = _binding.names
12
36
  local forge = _binding.forge
37
+ -- ▼ ReadonlyMap.forEach ▼
38
+ local _callback = function(_, name)
39
+ return createSource(name, forge)
40
+ end
41
+ for _k, _v in AppRegistry do
42
+ _callback(_v, _k, AppRegistry)
43
+ end
44
+ -- ▲ ReadonlyMap.forEach ▲
13
45
  if not __px then
14
46
  local _result = config
15
47
  if _result ~= nil then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/app-forge",
3
- "version": "0.6.0-alpha.14",
3
+ "version": "0.6.0-alpha.16",
4
4
  "description": "An App Manager for react",
5
5
  "main": "out/init.lua",
6
6
  "packageManager": "bun@1.3.1",