@quenty/templateprovider 7.4.0 → 7.4.1-canary.349.0657f6a.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.4.1-canary.349.0657f6a.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/templateprovider@7.4.0...@quenty/templateprovider@7.4.1-canary.349.0657f6a.0) (2023-04-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * Template registration order is respected ([11d0ef9](https://github.com/Quenty/NevermoreEngine/commit/11d0ef9411b3c3faa0041cd06adc6cc4f1acef70))
12
+
13
+
14
+
15
+
16
+
6
17
  # [7.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/templateprovider@7.3.0...@quenty/templateprovider@7.4.0) (2023-03-31)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/templateprovider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/templateprovider",
3
- "version": "7.4.0",
3
+ "version": "7.4.1-canary.349.0657f6a.0",
4
4
  "description": "Base of a template retrieval system",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,15 +25,15 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/baseobject": "^6.2.0",
29
- "@quenty/insertserviceutils": "^6.4.0",
30
- "@quenty/loader": "^6.2.0",
31
- "@quenty/maid": "^2.5.0",
32
- "@quenty/promise": "^6.4.0",
33
- "@quenty/string": "^3.1.0"
28
+ "@quenty/baseobject": "6.2.0",
29
+ "@quenty/insertserviceutils": "6.4.0",
30
+ "@quenty/loader": "6.2.0",
31
+ "@quenty/maid": "2.5.0",
32
+ "@quenty/promise": "6.4.0",
33
+ "@quenty/string": "3.1.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "2a1c35a8d2e90b291a83a6e2def0ec69f3f24837"
38
+ "gitHead": "0657f6a143db196decfbdc1b43edc89baa9bff67"
39
39
  }
@@ -58,13 +58,15 @@ function TemplateProvider.new(container, replicationParent)
58
58
 
59
59
  self._replicationParent = replicationParent
60
60
  self._containersToInitializeSet = {}
61
+ self._containersToInitializeList = {}
61
62
 
62
63
  if typeof(container) == "Instance" or type(container) == "number" then
63
- self._containersToInitializeSet[container] = true
64
+ self:_registerContainer(container)
64
65
  elseif typeof(container) == "table" then
65
66
  for _, item in pairs(container) do
66
67
  assert(typeof(item) == "Instance" or type(item) == "number", "Bad item in initialization set")
67
- self._containersToInitializeSet[item] = true
68
+
69
+ self:_registerContainer(item)
68
70
 
69
71
  -- For easy debugging/iteration loop
70
72
  if typeof(item) == "Instance"
@@ -79,12 +81,21 @@ function TemplateProvider.new(container, replicationParent)
79
81
 
80
82
  -- Make sure to replicate our parent
81
83
  if self._replicationParent then
82
- self._containersToInitializeSet[self._replicationParent] = true
84
+ self:_registerContainer(self._replicationParent)
83
85
  end
84
86
 
85
87
  return self
86
88
  end
87
89
 
90
+ function TemplateProvider:_registerContainer(container)
91
+ assert(typeof(container) == "Instance" or type(container) == "number", "Bad container")
92
+
93
+ if not self._containersToInitializeSet[container] then
94
+ self._containersToInitializeSet[container] = true
95
+ table.insert(self._containersToInitializeList, container)
96
+ end
97
+ end
98
+
88
99
  --[=[
89
100
  Initializes the container provider. Should be done via [ServiceBag].
90
101
  ]=]
@@ -98,7 +109,7 @@ function TemplateProvider:Init()
98
109
 
99
110
  self._promises = {} -- [name] = Promise
100
111
 
101
- for container, _ in pairs(self._containersToInitializeSet) do
112
+ for _, container in pairs(self._containersToInitializeList) do
102
113
  self:AddContainer(container)
103
114
  end
104
115
  end
@@ -358,10 +369,10 @@ end
358
369
 
359
370
  function TemplateProvider:_addToRegistery(child)
360
371
  local childName = child.Name
361
- if self._registry[childName] then
362
- warn(("[TemplateProvider._addToRegistery] - Duplicate %q in registery. Overridding")
363
- :format(childName))
364
- end
372
+ -- if self._registry[childName] then
373
+ -- warn(("[TemplateProvider._addToRegistery] - Duplicate %q in registery. Overridding")
374
+ -- :format(childName))
375
+ -- end
365
376
 
366
377
  self._registry[childName] = child
367
378