New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@farmfe/runtime

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@farmfe/runtime - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

6

CHANGELOG.md
# @farmfe/runtime
## 0.6.2
### Patch Changes
- 3073e19: Isolate runtime from globalThis for script entries
## 0.6.1

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@farmfe/runtime",
"version": "0.6.1",
"version": "0.6.2",
"description": "Runtime of Farm",

@@ -5,0 +5,0 @@ "author": {

import { ModuleSystem } from './module-system';
// Injected during build
declare const __farm_global_this__: any;
type FarmGlobalThis = (Window &
typeof globalThis &
typeof global &
typeof self) & {
noop: () => void;
__farm_module_system__: ModuleSystem;
};
const __farm_global_this__ = (globalThis ||
window ||
global ||
self) as FarmGlobalThis;
__farm_global_this__.noop = function () {
/* do nothing */
};
__farm_global_this__.__farm_module_system__ = (function () {

@@ -21,0 +6,0 @@ const moduleSystem = new ModuleSystem();

@@ -5,2 +5,4 @@ import { Module } from './module';

declare const __farmNodeRequire: (moduleId: string) => any;
/* eslint-disable @typescript-eslint/ban-ts-comment */

@@ -85,8 +87,2 @@ // @ts-ignore swc helpers does not have type definition

if (targetEnv === 'node') {
const { __farmNodeRequire } =
// TODO: polyfill globalThis
globalThis as unknown as {
__farmNodeRequire: (id: string) => any;
};
return __farmNodeRequire(moduleId);

@@ -93,0 +89,0 @@ }

@@ -8,7 +8,6 @@ // using native ability to load resources if target env is node.

export const targetEnv =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore do not check type here
(globalThis || global || window || self).__FARM_TARGET_ENV__ || 'node';
declare const __farm_global_this__: any;
export const targetEnv = __farm_global_this__.__FARM_TARGET_ENV__ || 'node';
/**

@@ -15,0 +14,0 @@ * Loading resources according to their type and target env.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc