Giter Club home page Giter Club logo

Comments (4)

yisar avatar yisar commented on July 16, 2024

感觉这块不需要在沙箱里运行,比如 mount 一般是 Fre.render(<App/>, document.getElementById("root")) 这里的 document 必须是全局 document

from berial.

asiainfoliwei avatar asiainfoliwei commented on July 16, 2024

感觉这块不需要在沙箱里运行,比如 mount 一般是 Fre.render(<App/>, document.getElementById("root")) 这里的 document 必须是全局 document

我提一个case呀,如果在生命周期里面需要访问子应用其他js之前定义的全局对象,是不是就访问不到了,第二个是
image
我看example都是主动把shadowdom root 传进去,如果生命周期函数也在沙箱里面执行的话是不是就可以改造是不是就可以小一点,proxy劫持domcument -> shadowdom root, 如果需要访问原始docuemnt可以在allowList加一个rowDocument

from berial.

yisar avatar yisar commented on July 16, 2024

proxy劫持domcument -> shadowdom root

这个是不现实的,document 和 shadow root 不是一个东西,我们之前也打算直接代理到沙雕上,但是 react 和 vue 这种框架对 document 的依赖比想象中的更多

fre 是可以的,因为 fre 只用了几个 document 的方法

你可以尝试一下,如果你能搞定的话,欢迎 pr

from berial.

asiainfoliwei avatar asiainfoliwei commented on July 16, 2024

我理解不用全部方法,把get dom节点的方法hack一份,就可以了,我看micro-app这边已经在用了
image

from berial.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.