Skip to content

Commit

Permalink
Merge branch 'v4' of https://github.com/V4Fire/Client into bonkalol/d…
Browse files Browse the repository at this point in the history
…ynamic-path
  • Loading branch information
bonkalol committed Dec 25, 2024
2 parents f0adb83 + 817ff8d commit a5a927e
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Changelog
_Note: Gaps between patch versions are faulty, broken or test releases._

## v4.0.0-beta.172 (2024-12-25)

#### :boom: Breaking Change

* Updated `@v4fire/core` to version `4.0.0-alpha.54` with renaming `Function.prototype.once` to `memoize`

## v4.0.0-beta.171 (2024-12-23)

#### :house: Internal
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"packageManager": "[email protected]",
"typings": "index.d.ts",
"license": "MIT",
"version": "4.0.0-beta.171",
"version": "4.0.0-beta.172",
"author": {
"name": "kobezzza",
"email": "[email protected]",
Expand Down Expand Up @@ -169,7 +169,7 @@
"@types/semver": "7.3.10",
"@types/webpack": "5.28.0",
"@v4fire/cli": "1.6.0",
"@v4fire/core": "4.0.0-alpha.53",
"@v4fire/core": "4.0.0-alpha.54",
"@v4fire/linters": "git+https://github.com/v4fire/linters#rework_rules",
"@v4fire/storybook": "0.8.0",
"@v4fire/storybook-framework-webpack5": "0.8.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/directives/bind-with/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* https://github.com/V4Fire/Client/blob/master/LICENSE
*/

import type { EventEmitterLike, PromiseLikeP } from 'core/async';
import type { EventEmitterLikeP, PromiseLikeP } from 'core/async';

import type { DirectiveBinding } from 'core/component/engines';
import type { WatchOptions } from 'core/component/interface';
Expand Down Expand Up @@ -62,7 +62,7 @@ export interface EventListener<A extends any[]> extends Handle<A> {
/**
* An event emitter to listen
*/
emitter?: EventEmitterLike | EventEmitterLike['on'];
emitter?: EventEmitterLikeP;

/**
* The event name to listen for, or a list of such events
Expand Down
1 change: 1 addition & 0 deletions src/components/directives/bind-with/test/unit/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ test.describe('components/directives/bind-with', () => {
const el = await renderDirective(page, {
emitter: (event: string, listener: AnyFunction) => {
document.body.addEventListener(event, listener);
return undefined;
},

on: 'testEvent'
Expand Down
2 changes: 1 addition & 1 deletion src/components/super/i-block/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export default abstract class iBlockBase extends iBlockFriends {
// eslint-disable-next-line prefer-const
unwatch: Nullable<Function>;

const emitter: Function = (_: any, wrappedHandler: RawWatchHandler<typeof that, T>) => {
const emitter = (_: any, wrappedHandler: RawWatchHandler<typeof that, T>) => {
wrappedHandler['originalLength'] = handler['originalLength'] ?? handler.length;
handler = wrappedHandler;

Expand Down
2 changes: 1 addition & 1 deletion src/core/component/engines/vue3/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function getComponent(meta: ComponentMeta): ComponentOptions<typeof Compo
unsafe.$vueWatch = this.$watch.bind(this);
init.beforeDataCreateState(ctx);

const emitter: Function = (_: unknown, handler: WatchHandler) => {
const emitter = (_: unknown, handler: WatchHandler) => {
// eslint-disable-next-line @v4fire/unbound-method
const {unwatch} = watch(unsafe.$fields, {deep: true, immediate: true}, handler);
return unwatch;
Expand Down
6 changes: 3 additions & 3 deletions src/core/component/init/states/before-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function beforeCreateState(

let fn = () => ('getRoot' in ctx ? ctx.getRoot?.() : null) ?? ctx.$root;

fn = fn.once();
fn = fn.memoize();

Object.defineProperty(ctx, $getRoot, {
configurable: true,
Expand Down Expand Up @@ -163,7 +163,7 @@ export function beforeCreateState(
return targetCtx[$getParent];
}

let fn: CanUndef<Function>;
let fn: CanUndef<AnyFunction>;

if (restArgs != null) {
// VNODE
Expand All @@ -179,7 +179,7 @@ export function beforeCreateState(
fn = () => ctx;
}

fn = fn.once();
fn = fn.memoize();

Object.defineProperty(targetCtx, $getParent, {
configurable: true,
Expand Down
2 changes: 1 addition & 1 deletion src/core/init/dependencies/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function* createDependencyIterator(
wait: expandedWait
};

expandedDependency.fn = expandedDependency.fn.once();
expandedDependency.fn = expandedDependency.fn.memoize();
expandedDependencies.set(dependency, expandedDependency);

return expandedDependency;
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5740,7 +5740,7 @@ __metadata:
"@types/webpack-env": "npm:1.18.1"
"@v4fire/cli": "npm:1.6.0"
"@v4fire/config": "npm:1.0.0"
"@v4fire/core": "npm:4.0.0-alpha.53"
"@v4fire/core": "npm:4.0.0-alpha.54"
"@v4fire/design-system": "npm:1.23.0"
"@v4fire/linters": "git+https://github.com/v4fire/linters#rework_rules"
"@v4fire/storybook": "npm:0.8.0"
Expand Down Expand Up @@ -6022,9 +6022,9 @@ __metadata:
languageName: node
linkType: hard

"@v4fire/core@npm:4.0.0-alpha.53":
version: 4.0.0-alpha.53
resolution: "@v4fire/core@npm:4.0.0-alpha.53"
"@v4fire/core@npm:4.0.0-alpha.54":
version: 4.0.0-alpha.54
resolution: "@v4fire/core@npm:4.0.0-alpha.54"
dependencies:
"@babel/core": "npm:7.17.5"
"@babel/helper-module-transforms": "npm:7.16.7"
Expand Down Expand Up @@ -6167,7 +6167,7 @@ __metadata:
optional: true
xhr2:
optional: true
checksum: e8d94bbb1c671f8b3b69b1671cd5cd9b5f4e42443ec0f68563cb387ef5b30a9b977696c2260ced8ccbb753f220e16b1f28a6462926b1b9a1129fd642122e753d
checksum: 9de3c4e4c9a65de159b44dd1055dcfca9f587ba7e6b134ae5957dde528388d1e5be5f904db9140861635d0b48cc15529ce26061e13ba275a148bdbf1c7bf8b45
languageName: node
linkType: hard

Expand Down

0 comments on commit a5a927e

Please sign in to comment.