Skip to content

Commit

Permalink
feat: remove compatibility shims
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-haynes committed Nov 3, 2023
1 parent 98243a8 commit acfb3aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 50 deletions.
41 changes: 0 additions & 41 deletions packages/container/src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,48 +131,7 @@ export function initContainer({
}),
});

// TODO remove debug value
const context = buildSafeProxy({
componentId,
props: {
// @ts-expect-error FIXME
accountId: props.accountId || 'andyh.near',
},
});

function asyncFetch(url: string, options: RequestInit) {
return fetch(url, options).catch(console.error);
}

const React = {
Fragment: 'div',
};
function fadeIn() {}
function slideIn() {}
let minWidth;

const styled = new Proxy(
{},
{
get(_, property: string) {
return (/*css: string*/) => {
return property;
};
},
}
);

return {
/* VM compatibility TODO determine what to keep */
asyncFetch,
fadeIn,
minWidth,
React,
slideIn,
styled,

/* Web Engine core */
context,
diffComponent,
processEvent,
props,
Expand Down
12 changes: 3 additions & 9 deletions packages/iframe/src/SandboxedIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,10 @@ function buildSandboxedComponent({
let props;
// TODO fixed with preact/compat?
const React = Preact;
const {
/* VM shims */
asyncFetch,
fadeIn,
minWidth,
React,
slideIn,
styled,
/* core dependencies */
context,
diffComponent,
processEvent,
props: containerProps,
Expand Down

0 comments on commit acfb3aa

Please sign in to comment.