ace modules can't be shared across windows #417

Closed
Gozala opened this Issue Sep 9, 2011 · 5 comments

Projects

None yet

3 participants

@Gozala
Contributor
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
        require("./boot.js").catalog.startupPlugins({
          env: require("pilot/environment").create(),
          document: document,
          window: window
        })
      } else {
        require({
          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.
@gissues:{"order":48.447204968944334,"status":"backlog"}

Contributor
fjakobs commented Dec 19, 2011

is this issue resolved by now?

Contributor
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).

Contributor
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.

Contributor
fjakobs commented Dec 20, 2011

OK, I will keep this open then.

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

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