runtime-compiler 4.2.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/build.js +1 -1
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/build.js CHANGED
@@ -1 +1 @@
1
- import{Worker}from"node:worker_threads";let workerOptions={eval:!0};export const runInWorker=code=>new Promise((res,rej)=>{let worker=new Worker(`import"runtime-compiler/env/build";${code};\nimport{__rtcpl_ct__}from"runtime-compiler";import{parentPort as __rtcpl_pp__}from"node:worker_threads";__rtcpl_pp__.postMessage(__rtcpl_ct__)`,workerOptions);worker.once("message",msg=>{res(msg);worker.terminate()});worker.once("error",rej)});export const compile=codes=>`import"runtime-compiler/env/aot";import{__rtcpl_aot_fns__ as a}from"runtime-compiler";a.push(${codes})`;
1
+ import{Worker}from"node:worker_threads";let workerOptions={eval:!0};export const runInWorker=code=>new Promise((res,rej)=>{let worker=new Worker(`import"runtime-compiler/env/build";${code};\nimport{__rtcpl_ct__}from"runtime-compiler";import{parentPort as __rtcpl_pp__}from"node:worker_threads";process.on('beforeExit',()=>__rtcpl_pp__.postMessage(__rtcpl_ct__))`,workerOptions);worker.once("message",msg=>{res(msg);worker.terminate()});worker.once("error",rej)});export const compile=codes=>`import"runtime-compiler/env/aot";import{__rtcpl_aot_fns__ as a}from"runtime-compiler";a.push(${codes})`;
package/index.js CHANGED
@@ -1 +1 @@
1
- import{IS_AOT,IS_BUILD}from"./env/index.js";let __rtcpl_r__=[];export const ref=value=>__rtcpl_r__.push(value)-1;export const createRef=()=>__rtcpl_r__.push(void 0)-1;export let __rtcpl_ct__;export let evaluate=IS_AOT?()=>__rtcpl_aot_fns__.pop()(__rtcpl_r__):IS_BUILD?content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");content=`$=>{${content}}`;__rtcpl_ct__=content+","+__rtcpl_ct__;return(0,eval)('"use strict";'+content)(__rtcpl_r__)}:content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");return(0,eval)(`"use strict";$=>{${content}}`)(__rtcpl_r__)};export let evaluateAsync=IS_AOT?evaluate:IS_BUILD?content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");content=`async $=>{${content}}`;__rtcpl_ct__=content+","+__rtcpl_ct__;return(0,eval)('"use strict";'+content)(__rtcpl_r__)}:content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");return(0,eval)(`"use strict";async $=>{${content}}`)(__rtcpl_r__)};export const __rtcpl_aot_fns__=[];export const deref=id=>__rtcpl_r__[id];
1
+ import{IS_AOT,IS_BUILD}from"./env/index.js";let __rtcpl_r__=[];export const ref=value=>__rtcpl_r__.push(value)-1;export const createRef=()=>__rtcpl_r__.push(void 0)-1;export let __rtcpl_ct__="";export let evaluate=IS_AOT?()=>__rtcpl_aot_fns__.pop()(__rtcpl_r__):IS_BUILD?content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");content=`$=>{${content}}`;__rtcpl_ct__=content+","+__rtcpl_ct__;return(0,eval)('"use strict";'+content)(__rtcpl_r__)}:content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");return(0,eval)(`"use strict";$=>{${content}}`)(__rtcpl_r__)};export let evaluateAsync=IS_AOT?evaluate:IS_BUILD?content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");content=`async $=>{${content}}`;__rtcpl_ct__=content+","+__rtcpl_ct__;return(0,eval)('"use strict";'+content)(__rtcpl_r__)}:content=>{if("string"!=typeof content)throw new Error("Expected a string for content in JIT & BUILD mode");return(0,eval)(`"use strict";async $=>{${content}}`)(__rtcpl_r__)};export const __rtcpl_aot_fns__=[];export const deref=id=>__rtcpl_r__[id];
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"runtime-compiler","version":"4.2.0","description":"A code generation system.","keywords":["rolldown-plugin","vite-plugin"],"homepage":"","license":"MIT","repository":"re-utils/runtime-compiler","type":"module","exports":{"./*":"./*.js",".":"./index.js","./env":"./env/index.js"}}
1
+ {"name":"runtime-compiler","version":"4.2.2","description":"A code generation system.","keywords":["rolldown-plugin","vite-plugin"],"homepage":"","license":"MIT","repository":"re-utils/runtime-compiler","type":"module","exports":{"./*":"./*.js",".":"./index.js","./env":"./env/index.js"}}