Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop xorigin.js and dependencies.js to reduce startup time, number of requests #736

Closed
humphd opened this issue Apr 20, 2017 · 2 comments
Closed

Comments

@humphd
Copy link

humphd commented Apr 20, 2017

Brackets loads two separate JS files on startup that really aren't needed by us. I'd like to delete them, and put some of what they do in other files. Here's what I need done:

  1. src/xorigin.js

Remove this file (git rm) and all references to it:

Gruntfile.js:                            'xorigin.js',
src/index.html:    <script type="application/javascript" src="xorigin.js"></script>

Test that you can still load Brackets successfully by starting the server (npm start) and browsing to http://localhost:8000/src/hosted.html

  1. src/dependencies.js

Take the code at https://github.com/mozilla/brackets/blob/master/src/dependencies.js#L49-L59 and rework it to live here: https://github.com/mozilla/brackets/blob/master/src/main.js#L122. Basically, I want a check to make sure we're running in an iframe, and if not, we document.write that error message. If we are running in an iframe, then you can continue to run the define() block (e.g., use an if/else or something for the two cases).

Once you've done that, git rm the src/dependencies.js file, and remove all references to it:

Gruntfile.js:                            'dependencies.js',
src/index.html:    <script src="dependencies.js"></script>

Once again, test that everything works. Make sure you test loading Brackets in both of the follow ways, the first should show your error, the second should work:

  • http://localhost:8000/src/index.html should show the error about the iframe
  • http://localhost:8000/src/hosted.html should allow the editor to load and not show the error about the iframe.

I'm assigning this bug to @Th30, who still needs a bug for his 0.4 release.

@Th30
Copy link

Th30 commented Apr 20, 2017

@humphd I'll "Nimble" when getting this done. :)

@Th30
Copy link

Th30 commented Apr 21, 2017

@humphd
Ok fixed, and tested.

PR:
#741

Tested on firefox, chrome and safari.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants