Comments (8)
Hi @oznekenzo I wish I could guarantee for sure that the index.d.ts
you added worked w/ TS. Simple definitions file like this has worked for me in the past to support TS on smaller packages with very simple interfaces. I tried adding it to my project yesterday but ended up giving up -- my react app was "ejected" from create-react-app
and has a very complex webpack configuration (ugh), and unfortunately I couldnt figure out how to splice 3box-comments-react
into it. It was difficult to debug because the 3box index.js is a very large file(!) and my code editor could barely even display, let alone ctrl-f or scroll thru to see what might be the issue.
Sorry I couldnt be more help on this front but I'm out of time.
Might circle back on this later (in a few months).
from 3box-comments-react.
There is no typescript support since this is not a typescript project :)
Feel free to contribute types to http://definitelytyped.org/ !
from 3box-comments-react.
I could shim in a solution for myself that fixes my own immediate problem, but it will result in duplicated effort in your ecosystem... on the other hand if i submit the solution to definitelytyped, i'm on the hook to maintain it and if its not my primary project then its going to fall out of date and probably result in alot of unhappy customers on your side.
(...I also have no idea if the other person in your Discord having build trouble with TS was able to resolve it, and if it even had anything to do with Typescript in the first place or some other issue elsewhere in your pipes...)
Most of the dapps in cryptoland use Typescript from what i've seen.
This request will be a frequent and recurring theme :)
from 3box-comments-react.
Saw a lot of long winded tutorials on adding ts support, but seems its as simple as just adding the index.d.ts file - hoping this is the case.
This file has been added, would be great for @laurengarcia to test with the [email protected]
npm beta release - once that's confirmed to work, will publish and can add support to our other components
from 3box-comments-react.
@laurengarcia thanks for the help on this one - closing
from 3box-comments-react.
We don't have TS support in the main 3box.js package at the moment, so perhaps ejecting your react app required you interface directly with 3box.js instead of though 3box-comments-react
(I don't know whether you are depending on 3box
elsewhere or if its coming in through the comments plugin). Is it just now a matter of providing the type interface for the 3box
lib?
from 3box-comments-react.
My workaround is lazy-loading 3box.js from the 3box CDN and adding it to my react app on the fly in the browser. In other words, I'm side-stepping the "build" step, so i don't have to worry about 3box.js TS at this point, but it would be nice to have. The downside of this approach being that i dont get the nice UI from this pkg, but it works for what i need to do for now.
from 3box-comments-react.
Figured it out, just leaving a note for some other poor soul out there who may be using create-react-app
in "ejected" mode (meaning all webpack and .tsconfig configs are unbundled so they can be customized):
You may need to set "allowSyntheticDefaultImports": true,
in your .tsconfig
file so it can consume and be backward-compatible with ES5 modules (like this one) that use module.exports
(vs. ES6 import/export syntax).
from 3box-comments-react.
Related Issues (20)
- Button to login to comments in order to view delete option
- Show delete option even when you haven't joined thread
- Allow users to reply to comments HOT 1
- Allow users to react to comments HOT 1
- Respect #hashtags on Comments plugin
- [900 DAI] Improve 3Box Comments Plugin 💬: Make 3Box Comments more social with Replies, Reactions, and Upvotes HOT 6
- Plugin improvements
- Update, test, and merge "reactions and replies" feature from hackathon submission HOT 1
- Update docs for new Comments features
- "Failed to compile" error with node-sass HOT 5
- Output CSS in build HOT 1
- loginFunction never getting called HOT 4
- crashes when currentUser3BoxProfile is cleared HOT 8
- Demo is broken HOT 4
- how to abort loginFunction?
- Comments are not being displayed even when given currentAccountAddress
- Comments not loading in hardened FireFox or Tor Browser HOT 2
- Build fails with Parcel
- Trouble updating to latest version HOT 4
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 3box-comments-react.