
Product
Introducing PHP and Composer Support in Socket
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.
@guardian/shimport
Advanced tools
Note, this is the same as https://github.com/Rich-Harris/shimport but exported as an ES module. See that repo for more information on how this works.
Quick start:
You can test for dynamic import support using something like:
try {
new Function('url', `return import(url)`)
} catch (e) // not supported
Then, to initialise shimport do:
import { initialise } from '@guardian/shimport'
initialise()
You can then call shimport as:
self.__shimport__
I.e. use this in place of 'import' to perform dynamic imports.
Note, the global name is hardcoded unfortunately.
Recommend adding the following types as globals for using this if you are a TS person:
interface Window {
__import__: (url: string) => Promise<any>;
__shimport__: any;
}
Very thankful to @Rich-Harris for the work.
A 2kb shim for import and export. Allows you to use JavaScript modules in all browsers, including dynamic import().
FAQs
Shim for dynamic import()
We found that @guardian/shimport demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 30 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.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.