Skip to content

Commit e228177

Browse files
committed
🎉 feat: merge main
1 parent b9dc808 commit e228177

File tree

3 files changed

+28
-33
lines changed

3 files changed

+28
-33
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 0.8.17 - 12 Feb 2024
2+
Feature:
3+
- [#474](https://github.com/elysiajs/elysia/pull/474) Numeric Cookie with length >= 16 cant be parsed to number
4+
- [#476](https://github.com/elysiajs/elysia/pull/476) Using a query key that contains a hyphen or a dot raises a SyntaxError
5+
- [#460](https://github.com/elysiajs/elysia/pull/460)
6+
- [#458](https://github.com/elysiajs/elysia/pull/458) Multiple scoped plugins do not register routes
7+
- [#457](https://github.com/elysiajs/elysia/pull/457) Elysia arguments scoped and prefix do not work at the same time
8+
9+
Change:
10+
- [#472](https://github.com/elysiajs/elysia/pull/472) Move documentation issue template to documentation repository
11+
112
# 0.8.16 - 6 Feb 2024
213
Feature:
314
- [#448](https://github.com/elysiajs/elysia/pull/448) BooleanString - @bogeychan

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "elysia",
33
"description": "Ergonomic Framework for Human",
4-
"version": "0.8.16",
4+
"version": "0.8.17",
55
"author": {
66
"name": "saltyAom",
77
"url": "https://github.com/SaltyAom",

src/index.ts

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,54 +1907,38 @@ export default class Elysia<
19071907
Object.assign(context.store, this.store)
19081908
})
19091909

1910-
plugin.event.trace = [
1911-
...(this.event.trace || []),
1912-
...(plugin.event.trace || [])
1913-
]
1914-
1915-
1910+
if (plugin.event.trace.length)
1911+
plugin.event.trace.push(...plugin.event.trace)
19161912

19171913
if (isScoped && !plugin.config.prefix)
19181914
console.warn(
19191915
'When using scoped plugins it is recommended to use a prefix, else routing may not work correctly for the second scoped instance'
1920-
)
1916+
)
1917+
1918+
if (plugin.event.error.length)
1919+
plugin.event.error.push(...this.event.error)
19211920

1922-
/* Run global error handlers after the error handlers of the plugin are done executing.
1923-
TODO
1924-
- should this really be handled here or is there some kind of merging failing?
1925-
- should this also be applicable for other handlers?
1926-
It seems like this only affects scoped changes. so it could be moved inside the below if block */
1927-
1928-
plugin.event.error.push(...this.event.error);
1929-
19301921
if (plugin.config.aot) plugin.compile()
19311922

19321923
let instance
19331924

19341925
if (isScoped && plugin.config.prefix) {
1935-
19361926
instance = this.mount(plugin.config.prefix + '/', plugin.fetch)
19371927

1938-
//Ensure that when using plugins routes are correctly showing up in the .routes property. Else plugins e.g. swagger will not correctly work.
1939-
//This also avoids adding routes multiple times.
1940-
1941-
plugin.routes.forEach((r) => {
1928+
// Ensure that when using plugins routes are correctly showing up in the .routes property. Else plugins e.g. swagger will not correctly work.
1929+
// This also avoids adding routes multiple times.
1930+
for (const route of plugin.routes)
19421931
this.routes.push({
1943-
...r,
1944-
path: `${plugin.config.prefix}${r.path}`,
1945-
//This probably has no effect as the routes object itself is not used to execute these handlers? The plugin is taking care of it.
1946-
hooks: mergeHook(
1947-
r.hooks,
1948-
{
1949-
error: this.event.error
1950-
}
1951-
)
1932+
...route,
1933+
path: `${plugin.config.prefix}${route.path}`,
1934+
hooks: mergeHook(route.hooks, {
1935+
error: this.event.error
1936+
})
19521937
})
1953-
})
19541938
} else {
1955-
19561939
instance = this.mount(plugin.fetch)
1957-
this.routes = this.routes.concat(instance.routes)
1940+
1941+
if (instance.routes.length) this.routes.push(...instance.routes)
19581942
}
19591943

19601944
return this

0 commit comments

Comments
 (0)