
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ExF - TS is TypeScript/JavaScript Library for building Custom Web Components. Its purpose is to refine Web Components and present a cool way for their composing.
In the next few lines I will list some of the features that ExF combines to gain his super powers.
Web Components - This is a technology with which help I manage to combine the super powers of technologies listed below.
Shadow DOM - Important part of ExF is encapsulation and here the Shadow DOM intervenes.
Virtual DOM - To make things easier, more sustainable and more dynamic, ExF uses Virtual Dom and updates only what is necessary.
TSX - It's actually JSX.
etc...
Just clone this repository:
https://github.com/aleksandar9999a/exf-template
And run:
yarn install
yarn start
This will create webpack server, after this write what you want in src folder
const runtime = createRuntime()
/* We pass rules to runtime so platforms which pass that rules will be mounted */
const rules = {}
runtime.createPlatform({
name: 'ex',
providers: {
service: {
type: 'singleton',
value: () => import('./Service)
}
},
components: [
{ tag: 'app', element: () => import('./Component') }
],
bootstrap: {
element: 'app',
container: 'body'
},
global: {
style: `
.bg-red {
background: red;
}
`
},
conditions (rules) {
return true
}
})
runtime.run(rules)
Runtime looks a little bit as micro front-ends. You can image that platforms are as different apps which can be lazy loaded depending on certain conditions.
const platform = createPlatform({
name: 'ex',
providers: {
service: {
type: 'singleton',
value: () => import('./Service)
}
},
components: [
{ tag: 'app', element: () => import('./Component') }
],
bootstrap: {
element: 'app',
container: 'body'
},
global: {
style: `
.bg-red {
background: red;
}
`
}
})
platform.mount()
Platform is actually app configuration. It registered services, components, global properties and etc. Platform provides 5 basic options:
export default (element: Element, dep: { service: () => Promise<{}>}) => {
const counter = element.observe(0)
const interval = setInterval(() => {
counter.value++
}, 1000)
element.onUnmount(() => {
clearInterval(interval)
})
return () => {
return (
<div className="bg-red">
<slot><div>{counter}</div></slot>
</div>
)
}
}
/* or */
export default createElement('ex-app', (element: Element, dep: { service: () => Promise<{}>}) => {
const counter = element.observe(0)
const interval = setInterval(() => {
counter.value++
}, 1000)
element.onUnmount(() => {
clearInterval(interval)
})
return () => {
return (
<div className="bg-red">
<slot><div>{counter}</div></slot>
</div>
)
}
})
/* or */
class Service {
get (id: string) {
return Promise.resolve({ id })
}
}
export default async (element: Element, dep: { service: () => Promise<Service>}) => {
const counter = element.observe(0)
const service = await dep.service()
service.get(5)
.then(console.debug)
.catch(console.debug)
const interval = setInterval(() => {
counter.value++
}, 1000)
element.onUnmount(() => {
clearInterval(interval)
})
return () => {
return (
<div className="bg-red">
<slot><div>{counter.value}</div></slot>
</div>
)
}
}
Actually component is very simple. It is a function which receive element and providers, it can be async and return function which return jsx.
{
value: T,
pipe (fn: (value: T, oldValue: T) => any) => any,
watch (fn: (value: T, oldValue: T) => any) => any,
}
You can make different magic with it. For example you can watch changes on that value as you pass function to watch or you can transform value via pipe, so when you set value, pipes are executed and result at the end will be set as value
FAQs
Unknown package
We found that exf-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.