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

Including via <script> tag? #148

Open
odigity opened this issue Nov 9, 2016 · 6 comments
Open

Including via <script> tag? #148

odigity opened this issue Nov 9, 2016 · 6 comments

Comments

@odigity
Copy link

odigity commented Nov 9, 2016

Is it possible to simply load the Re-base library via a <script> tag? I don't have a build process set up for my current project, and I haven't learned Webpack yet, but it looks like there are Webpack references throughout the code...

(I did try including the dist/bundle.js file from github, but when I try to call Rebase.createClass(), I get a Rebase not defined error.)

@qwales1
Copy link
Collaborator

qwales1 commented Nov 11, 2016

@odigity The current webpack configuration does not expose Rebase as a global variable so it wouldn't work in a script tag. It could be changed though to allow for this. I am not going to have access to a computer for another week or so but would be glad to help when I get back and can give more detailed steps.

@haluvibe
Copy link

have you tried create react app repository? It is the official supported build tool for React by facebook. Fully featured build tool with no configuration needed

@odigity
Copy link
Author

odigity commented Nov 24, 2016

@haluvibe I have not. I'm specifically trying to avoid requiring a build process for my current project as it's intended to be an instructional demo for kids, and I want to keep things as simple as possible.

And really, it should be possible to load important JS libraries via script tag for quick hacking and experimentation without having to have a local dev env and tons of modules installed, at least if you want to make it easier to try out re-base.

For now, I guess I'll skip it and wire up React to Firebase manually. :(

@qwales1
Copy link
Collaborator

qwales1 commented Nov 24, 2016

@odigity sorry for the delay responding to this. It is possible to expose Rebase as a global variable. Can you try this branch and see if you run into any issues? The file to include is /dist/Rebase.js and you would need to include firebase before it. It will expose the lib as Rebase

@odigity
Copy link
Author

odigity commented Nov 26, 2016

@qwales1 No need to apologize, 1 day is very prompt in GitHub land - and I went 16 days in between comments. :)

I've already started building my app without rebase, which is not a bad thing, as this is my first app using either React or Firebase, and staying close to the framework and doing the wiring myself is a great learning opportunity.

But I'll try to circle back soon when I get a break and try out your suggestion. (I'll add it to my todo list.)

@bdougie
Copy link
Contributor

bdougie commented Dec 26, 2016

@odigity unpkg.com is a great tool to include npm packages in script tags. Include the following in a script perhaps. Let me know if this helps

https://unpkg.com/[email protected]/dist/bundle.js

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

4 participants