Comments (9)
@maltoze it's possible, just most people use a bundler and it hasn't been on our roadmap. I'd have to add a umd
file to our package.json and then it looks like you'd be able to use https://unpkg.com/ to grab the code in a script tag
from giphy-js.
@colorgold you can use the TypeScript Compiler
It's how we compile most of the code in this repo.
You'll just do:
tsc index.ts
Then the rest of the configuration comes from the tsconfig.json. Here is our tsconfig.json
from giphy-js.
@colorgold you can use the TypeScript Compiler
It's how we compile most of the code in this repo.
You'll just do:
tsc index.tsThen the rest of the configuration comes from the tsconfig.json. Here is our tsconfig.json
Thank you for your response and patience. In my html file, do I reference the index.ts
script or index.js
? I copied the tsconfig.json
you provided me with but I'm still having problems. For now I will go read the documentation on TypeScript Compiler to learn how to use it. Thanks again for the information.
from giphy-js.
@colorgold no problem! you'd reference the index.js
from you html script src.
from giphy-js.
@colorgold no problem! you'd reference the
index.js
from you html script src.
I installed the TypeScript compiler but now I get a different error. This is what my code looks like:
If I remove the 2nd line in chat.js, I then get this error:
I don't know what I am doing wrong. I have read that putting a dummy var exports
and var require
works, but as expected, it did not load GIFs.
from giphy-js.
Ah I may have mislead you about tsc
, we use that for our repo, but that is for our libraries, not for a bundle you'd use in a web page.
Take a look at https://parceljs.org/
It should be easy to get the bundled file you need for use with a script tag.
from giphy-js.
Ah I may have mislead you about
tsc
, we use that for our repo, but that is for our libraries, not for a bundle you'd use in a web page.Take a look at https://parceljs.org/
It should be easy to get the bundled file you need for use with a script tag.
Would I still need tsc
or do I get rid of all the js
files created? I will go ahead and use parcel and see what happens. Thank you!
from giphy-js.
Thank you for recommending me Parcel
. I was using webpack before and was getting so confused. So, the problem that I was having was that I was using my own server since I am also working with Firebase hosting
. Parcel
created a directory named dist
, but my server serves files under my public
directory; every time I ran my web app I got errors because the browser did not have access to the dist
directory. I was able to catch my mistake by creating a new project in Visual Studio Code
. I ran the project in the server that Parcel
gave me and voila, the Giphy carousel
loaded successfully. Now all I have to do is organize my original project.
Thank you so much for helping me and guiding me to solve my problem.
from giphy-js.
Ah I may have mislead you about
tsc
, we use that for our repo, but that is for our libraries, not for a bundle you'd use in a web page.Take a look at https://parceljs.org/
It should be easy to get the bundled file you need for use with a script tag.
Why doesn't provide a version that can be used directly in <script>
?
from giphy-js.
Related Issues (20)
- How to pick the format having only the id? HOT 3
- Gif does not support keypress event HOT 3
- At Grid component: "Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method." HOT 1
- Add support for AbortController HOT 1
- Consider making pingback and remote fonts configurable HOT 4
- Why there is no 'clips' type? HOT 1
- Carousel does not pass noLink property HOT 1
- Giphy React Grid component is not working HOT 4
- Please upgrade to react18 HOT 5
- SearchBar component make search button optional HOT 2
- Giphy/react-components 5.13.0 corporate proxy issue HOT 1
- renderGrid gifs positions are not set properly in lit HOT 2
- Focused Gif is not visually emphasized HOT 4
- Remove Grid not working HOT 1
- `require` in ESM build HOT 2
- `SyntaxError: Named export 'appendGiphySDKRequestHeader' not found. The requested module '@giphy/js-util' is a CommonJS module, which may not support all module.exports as named exports.` HOT 2
- It is advised to avoid ship styled-components in the build bundle. HOT 5
- React logging errors similar to "React does not recognize the `isFirstLoad` prop on a DOM element." HOT 1
- Next.js build fails: "Module not found: Can't resolve 'styled-components'" HOT 2
- Security concern: qs vulnerable to Prototype Pollution
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from giphy-js.