Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@domql/dependency-injector
Advanced tools
Globusa exports one function, parse()
, that takes a string of javascript code
and returns an object that looks like this:
{
imports: [], // mitosis-style import objects
declarations: [], // strings
exports: [], // strings
domqlComponents: [], // [ { name: null/string, code: string }, ... ]
linesExcludingImports: [], //
identifiers: [], // strings
}
At its core, dependency-injector handles the global scope in a javascript file that exports domql components so that the component can easily be converted to other frameworks using to-mitosis.
Basically, with the help of Globusa, Kalduna can convert something like this:
import { Text } from '@symbo.ls/atoms'
import { someFunction } from './Atoms/Flex'
const localFn = (a,b) => a + b
export const Title = {
extend: Text,
style: { fontSize: '55px' },
on: { click: (ev, el) => { console.log(someFunction(ev), localFn(1, 2)) } }
}
Into this: (notice the imports and the localFn
declaration)
import { Text } from '@symbo.ls/atoms' // Kalduna will include this
import { someFunction } from './Atoms/Flex' // Included by dependency-injector
const localFn = (a,b) => a + b // Copied by dependency-injector
export default function Title(props) {
const el = {
props: ...
parent: ...
...
}
function Text_onClick(ev, el) {
console.log(someFunction(ev), localFn(1, 2))
}
return (
<Text
style={`${css({ fontSize: '55px' })}`)
onClick={(ev) => Text_onClick(ev, el)}
...props />
)
}
The testing scheme is based off of Kalduna's testing scheme.
We use node's built-in assertion module instead of a separate library.
To run the entire test suite, do yarn test
from the root of this
repository.
To run only specific tests, simply pass a file name or pattern to the script:
yarn test dedup-mitosis-imports.test.js
# or
yarn test dedup*.test.js
tests/esbuild-tests.js
compiles all the .test.js
files from tests/
and
puts them in tests/dist/
.tests/dist/
is run with node as a separate
process so that if a crash happens in one suite, it doesn't affect the other
ones.FAQs
Handle global scope in domql components
The npm package @domql/dependency-injector receives a total of 0 weekly downloads. As such, @domql/dependency-injector popularity was classified as not popular.
We found that @domql/dependency-injector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.