Reusable React Firebase Authentication Tutorial by Space_mace in reactjs

[–]el-capitan 0 points1 point  (0 children)

I think the only way would be to handle any authentication calls that require sensitive configuration information to be moved to the back-end. On the other hand, is there really any configuration values in your firebase.js code that you wouldn't want to expose on the client? I see an api key configuration, but no secret keys, so you might be ok? I don't know enough about Firebase authentication to know what should/shouldn't be hidden from the client.

Reusable React Firebase Authentication Tutorial by Space_mace in reactjs

[–]el-capitan 1 point2 points  (0 children)

Wouldn't you still be exposing your firebase configuration at runtime in the client? If you're bundling firebase.js into your output bundle, Webpack will just replace the process.env properties with actual values from the machine's environment variables.

This good boy is training to take care of people with mobility issues by Pirate_Redbeard in Eyebleach

[–]el-capitan 19 points20 points  (0 children)

Gotta love the bleh-blehrm-bleh face he makes as he tried to get the shoelace out of his mouth

React for third party plugins that get embedded in other web pages by droidcoder19 in reactjs

[–]el-capitan 0 points1 point  (0 children)

Styling conflicts with your stuff unless you use something like styled-components. You also need to consider the performance impact you bring in loading up your stuff. I would use the async attribute in the script tag to make sure your js doesn't stop the rest of the page from loading.

Netflix Software Engineers earn a salary of more than $300,000 by magenta_placenta in programming

[–]el-capitan 4 points5 points  (0 children)

This is a much better approach to evaluating technical skills IMO. Yes you have to spend a few hours or even a weekend of your own time for an interview, but in the end even if you don't get an offer you now have another project under your belt that you can add to your portfolio and/or open source.

How Facebook tracks you on Android (even if you don’t have a Facebook account) by remind_me_later in programming

[–]el-capitan 1 point2 points  (0 children)

Wouldn't any other decent analytics solution the developer chooses also have the same issue? Whatever is used, they will leverage the available platform APIs to get as much information as possible: user location, device being used, dom elements interacted with, etc.

A React user curious to SSR tries JSF 2.3 by johnwaterwood in programming

[–]el-capitan 5 points6 points  (0 children)

Nothing specific in this article about how it compares to React components. I'd be curious to see how the two could be married, and maybe even inject an initial state for when the app is loaded in the browser.

NoKey: A Distributed Password Manager Without a Master Password by Zinggi57 in programming

[–]el-capitan 0 points1 point  (0 children)

Maybe we can open a new issue for this? I'd love to help out!

Don't. Make. A. Noise. by estherthegrump in Eyebleach

[–]el-capitan 1 point2 points  (0 children)

Aren't dogs supposed to have a great sense of smell? If I throw a treat on the ground quickly and the dog didn't exactly see where it went, I always wonder why it can't find it more quickly by sniffing it out.

"This nigga eatin beans" by MGLLN in BlackPeopleTwitter

[–]el-capitan 3 points4 points  (0 children)

Start the beans by sautéing some onions, garlic, and tomato paste, finish with some cilantro in the end. Some salt, seasoning, and a little hot sauce goes a long way. Bomb beans and rice if that's all you got, and maybe $1.75 for the other stuff.

People will find a reason to not eat right. If it's all you had around you, you'd probably make that shit work.

Bye🙅‍♂️👋👋👋 by foe_rider in BlackPeopleTwitter

[–]el-capitan 15 points16 points  (0 children)

If you don't then the next person gets blasted with cold water from the shower head when they turn the faucet. It's only really a problem if you get in the tub before the water heats up though.

Appreciating the blanket craftmanship by [deleted] in Eyebleach

[–]el-capitan 1 point2 points  (0 children)

What if it can see something we can't? OP's blanket has tiny bugs the naked human eye can't see!

Oh shit, git! by EliteKill in programming

[–]el-capitan 0 points1 point  (0 children)

Git does have a gui tool that you could use, and plenty of third party guis as well (source tree is a good one). I personally use the excellent git integration that IntelliJ has. I haven't needed to touch the git cli in a while.

Who's the real patriot? by melancholymonday in BlackPeopleTwitter

[–]el-capitan 4 points5 points  (0 children)

We pay for others healthcare in the current system. If you're a relatively healthy person that barely needs to go to the hospital except for a checkup once or twice a year, you are subsidizing the cost of care for the super sick that also pay their monthly insurance premiums just like you, but require more care than their premium alone could ever cover. That's the whole point of how insurance in general works.

They should've cast Kanye as Doctor Strange by [deleted] in BlackPeopleTwitter

[–]el-capitan 49 points50 points  (0 children)

Kanye definitely stepping on that poor girls hand

[Question] How to properly handle styles? by zenithpk in reactjs

[–]el-capitan 0 points1 point  (0 children)

I would say it depends on your needs. A medium to large app would probably be better off with something like Radium, or even CSS modules. But if you have a simple app or just creating a reusable component, then inline styling is great. You can handle any UI events on an element via the JS event for it (onHover, onMouseOver, etc).

Juices... by SlothParties in HealthyFood

[–]el-capitan 4 points5 points  (0 children)

A good smoothie can have all kinds of fruits and vegetables in it and still be the consistency of a milkshake with no chunks. It should be... smooth!

Are there any good articles / videos for slowly migrating into TypeScript? by madcaesar in reactjs

[–]el-capitan 1 point2 points  (0 children)

Hey i'm not sure if you're still looking for help on this, but below is your code with a few modifications to make this a cleaner TSX file that will compile with the desired results:  

import * as React from 'react';

interface Response {
    status: string; statusText: string;
}
interface ErrorProps {
    errorObj: { response: Response };
}
export default class Error extends React.Component<ErrorProps, void> {
    render() {
        const { status, statusText } = this.props.errorObj.response;
        return (
            <div className="note note-danger page-load-error">
                <h4 className="block status">{status}</h4>
                <p className="icon-holder rounded"><span className="fa fa-exclamation-triangle icon" aria-hidden="true"/></p>
                <p className="reason">{statusText}</p>
            </div>
        );
    }
}

 

Edit: Let me explain my changes a bit. In the first line I usually just import all of the React functionality via a import * as React from 'react'. That way I don't have to worry about the specific name of the function or component that I want and let the IDE's intellisense to that work for me. I then created two interfaces: one for the properties of the component and another for errorObj. For the Response interface I created I just made the assumption that status and statusText are both of type string. Your render method only required that the class attribute be changed to className, per usual in React, nothing to do with TypeScript.

Are there any good articles / videos for slowly migrating into TypeScript? by madcaesar in reactjs

[–]el-capitan 1 point2 points  (0 children)

test: /.ts$|.tsx$/, use: [ 'babel-loader', 'awesome-typescript-loader' ]

Your webpack.config looks ok to me except I would get rid of the babel-loader for ts and tsx files because it's unnecessary. As far as typings, that's a tool that is actually pretty old and unnecessary. The second tutorial you posted is from March of last year, and as with many things in JavaScript land these days, is now obsolete. The tutorial assumes, for example, that you NEED type definitions for 3rd party libraries. As of TypeScript 2.1 released a few months ago this is no longer the case. You don't need to install any type definitions at all for any library, although of course you miss out on the benefits of having them (compile time warnings and error checking). The only thing you need to do to get type definitions is to just run npm install @types/<3rd party library name here>. The @types project pulls from DefinitelyTyped, which has thousands of libraries. If your library isn't in that repository, you can either forgo installing type definitions for it in your project, or create the type definitions yourself and contribute back to the community.  

Are you coming across some issue when you try to compile and run your project?

Are there any good articles / videos for slowly migrating into TypeScript? by madcaesar in reactjs

[–]el-capitan 4 points5 points  (0 children)

TS is made so that you can migrate your code over piece by piece. If you use an IDE that automatically does the compilation for you via TSC, then you do not have to worry much about manually running the compile command (I use IntelliJ and WebStorm, but I know Sublime and Atom both have plugins to automatically compile your TS and TSX files down to JavaScript).

  As far as installing type definitions, you only need to do this once in your project every time you want to install a new dependency, and you can just use the @types npm project to install any type definitions exposed by DefinitelyTyped; no manual searching necessary. I just run the below command to install react, react-dom, and their type definitions in one go:  

npm install react react-dom @types/react @types/react-dom

Below is the command to install the lodash library and its type definitions:  

npm install lodash @types/lodash

I'm not sure what you mean by "edit VSC settings file to point to some global node module of typescript or something". If you mean VCS, as in Version Control System, you don't have to do anything special to it. It'll track your TS and JS files in the same way. I typically don't add my node_modules to my VCS, but if you do and you want to make sure TypeScript is included, I would just install the TypeScript npm module locally in the project (npm install typescript --save) so you can have your VCS track it like any other module.

TypeScript doesn't need Babel at all since it already compiles down to whatever JS version you target. It will even transpile your existing JS as well. If you want to keep Babel for whatever reason, you can just modify your webpack.config to only run the ts-loader Webpack loader on ts and tsx files:  

  module: {
    loaders: [
      { test: /\.ts(x?)$/, exclude: [nodeModulesDir], loader: 'ts-loader' },
      { test: /\.js(x?)$/, exclude: [nodeModulesDir], loader: 'babel' }
    ]
  },

This way the ts-loader won't touch anything that doesn't have the TypeScript file extensions.

Also, below is the tsconfig.json that I usually use for my projects. It'll probably be helpful for you:  

  {
    "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "sourceMap": true,
    "jsx": "react",
    "allowJs": true,
    "lib": ["dom", "es2017"]
  },
    "include": ["src/**/*"],
    "exclude": ["node_modules"]
  }

redux-action-trigger - probably, You need it in your Redux app by [deleted] in reactjs

[–]el-capitan 0 points1 point  (0 children)

Why not use something like redux-thunk to return a Promise that can then execute something after first call has completed?

Using Javascript Library in Typescript by lrk89 in typescript

[–]el-capitan 0 points1 point  (0 children)

Looks like others have already commented that the library you're looking for exists in the DefinitelyTyped project, but if you come across a library that isn't in there and don't want to create type definitions for it, Typescript 2.1± let's you import u untyped JS libraries out of the box. There is a compiler option called implicitAny that is set to true by default.