ace modules can't be shared across windows #417

Gozala opened this Issue Sep 9, 2011 · 5 comments


None yet

3 participants

Gozala commented Sep 9, 2011

In sky-edit I use browser tab per buffer, since ace is quite heavy loading it from scratch per tab is kind of slowish, so I decided to share modules across different tabs, in a following way:

if (window.opener) {
        require = window.opener.require
          env: require("pilot/environment").create(),
          document: document,
          window: window
      } else {
          paths: {
            ace: "./support/ace/lib/ace",
            gcli: "./support/cockpit/lib/cockpit",
            cockpit: "./support/cockpit/lib/cockpit",
            pilot: "./support/pilot/lib/pilot",
            vice: "./support/vice",
            launcher: "./launcher",
            fs: "./fs",
            text: "./text"
        require([ './boot.js' ])

Unfortunately this does not works out of the box, manly because document and window are treated as globals. After some hacking I got core part working, also I'm willing to make pull request with necessary changes if it's going to be accepted.

fjakobs commented Dec 19, 2011

is this issue resolved by now?

Gozala commented Dec 19, 2011

@fjakobs Unfortunately I don't have a time to work on this right now, so I can't confirm that it's fixed. Probably it's ok to close this issue for now. I can reopen / create new once if I'll run into it in a future (once I'll get time).

Gozala commented Dec 19, 2011

At some point I might even try to writing patch against cloud9 suggesting use of browser tabs instead of ones you got now.

fjakobs commented Dec 20, 2011

OK, I will keep this open then.

@nightwing nightwing added the ice-box label May 29, 2014

On new browsers loading ace is quite fast, and there is a new problem with setTimeout/setInterval having minimum of 400ms for background tabs.
So i think doing this will be more trouble than it's worth. Closing for now.

@nightwing nightwing closed this May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment