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

Consider use of unpkg CDN for REPL libraries #162

Open
MattMS opened this issue Nov 29, 2016 · 9 comments
Open

Consider use of unpkg CDN for REPL libraries #162

MattMS opened this issue Nov 29, 2016 · 9 comments

Comments

@MattMS
Copy link
Member

MattMS commented Nov 29, 2016

Since there have been reliability issues with the REPL libraries in the past, would it be worthwhile switching over to unpkg?

It has a latest version redirect as well as allowing specific versions.

My understanding of the currently used wzrd.in service is that it performs extra steps to bundle the code, but since the code is already bundled in the repo, maybe it would be quicker to use a straight CDN.

@buzzdecafe
Copy link
Member

what wzrd gives up is "browserify as a service" which i believe is required to serve up RF and S which are not bundled for the browser

@MattMS
Copy link
Member Author

MattMS commented Nov 30, 2016

Given the benefits of having a browser version in the package, would it be worthwhile adding these to Ramda Fantasy?

I hope @davidchambers doesn't mind me pinging him on his thoughts of adding it to Sanctuary.

@davidchambers
Copy link
Member

what wzrd gives up is "browserify as a service" which i believe is required to serve up RF and S which are not bundled for the browser

Actually, Sanctuary should run in the browser.

@MattMS
Copy link
Member Author

MattMS commented Nov 30, 2016

So it would be possible to serve it up with unpkg?

@davidchambers
Copy link
Member

So it would be possible to serve it up with unpkg?

Yes. I just confirmed that this works:

<script src="https://unpkg.com/[email protected]/dist/ramda.js"></script>
<script src="https://unpkg.com/[email protected]/index.js"></script>
<script src="https://unpkg.com/[email protected]/index.js"></script>

Keep in mind that the Sanctuary module is exported as window.sanctuary, so you may need something like window.S = window.sanctuary; somewhere. :)

@buzzdecafe
Copy link
Member

in that case we could either bundle RF for the browser or just use S. either is fine with me

@MattMS
Copy link
Member Author

MattMS commented Nov 30, 2016

Quickest fix would seem to be adding a prepublish script to run browserify on Ramda-Fantasy.
The browser file can be ignored from the Git repo (and that seems to be encouraged).

Rebinding variables for the REPL would be a useful option.
I'm not sure if it already does it, although I have seen there seems to be options on what gets exposed, and I guess that is similar.

I haven't looked at the Ramda Fantasy code at all, but I could have a go at hooking up that script if people are keen.

@buzzdecafe
Copy link
Member

@MattMS you can reuse or supercede this
https://github.com/ramda/ramda-fantasy/pull/129/files

@MattMS
Copy link
Member Author

MattMS commented Dec 1, 2016

@buzzdecafe (if I'm not mistaken) it seems that PR only needs the dist files removed and added to .gitignore.

In that case, would it be easier for you to make that change?

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

No branches or pull requests

3 participants