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

Experiment gpf.require.define to leverage script tags instead of ajax loading #263

Open
ArnaudBuchholz opened this issue Jun 22, 2018 · 3 comments
Assignees

Comments

@ArnaudBuchholz
Copy link
Owner

No description provided.

@ArnaudBuchholz
Copy link
Owner Author

Found the following pattern:

var link = document.createElement("link");
link.rel = "import";
link.href = "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/lib/js/head.min.js";
link.addEventListener("load", function () {
    alert(link.import.body.innerHTML);
});
document.body.appendChild(link);

Obviously, it does not work on IE but it allows to use CORS-enabled component (where AJAX can't)

@ArnaudBuchholz
Copy link
Owner Author

I need to do additional tests to assess compatibility

@ArnaudBuchholz
Copy link
Owner Author

Since I am not clear how this must be integrated in the lib, it can be:

  • either specific to the gpf.require API (through gpf.typedef.requireOptions)
  • or generic to the gpf.load API's browser implementation. In that case, a compatibility grid must be setup to determine when the mechanism is used or the dev may decide through an option that would be set through a global variable or on the script tag that includes the gpf lib.

In any case, the main benefit is to bypass today's limitations with AJAX requests (even if it is not a blocking limitation)

Putting back in the backlog until the need becomes obvious.

@ArnaudBuchholz ArnaudBuchholz removed this from the Release 0.2.7: TBD milestone Jul 18, 2018
@ArnaudBuchholz ArnaudBuchholz added this to the 0.3.1: Optimization milestone Mar 9, 2019
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

1 participant