Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

Consider replacing node dependencies in iframe with source from CDNs #75

Open
chriscox opened this issue Feb 17, 2017 · 2 comments
Open

Comments

@chriscox
Copy link
Member

chriscox commented Feb 17, 2017

Remixer has a few dependencies in the iframe overlay, such as Firebase, MDL, and React. They are pulled in via running npm install. However this makes using remixer in online tools such as codepen difficult, as you cannot simply import remixer by itself, and instead need to include all the dependencies.

As a suggestion, lets consider instead pulling in these dependencies via their recommended hosted CDNs from within the iframe.

We don't need to worry about performance here, as the iframe loads in background not needed immediately at page startup.

For reference, the iframe calling code is here.

Suggested CDNs:

Firebase
<script src="https://www.gstatic.com/firebasejs/3.6.9/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.6.9/firebase-database.js"></script>

MDL
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>

React
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"></script>
@chriscox
Copy link
Member Author

@appsforartists @chuga Hey guys, what do you think? Let me know if you have any strong opinions here one way or the other.

@appsforartists
Copy link
Member

I know Michael (who runs unpkg) and trust him to be a good person. I've run plenty of code he's written. Still, I'm wary to recommend that people load code from servers we don't control (and hence, can't vouch for the security of).

It's probably fine (React even links to that URL from their homepage), but it's still something I'm wary of as a Googler.

What's the bundle size difference between including these and externalizing them?

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

No branches or pull requests

2 participants