frontend

How to bundle typescript files for the browser user gulp and tsproject?

我的梦境 提交于 2019-12-11 02:39:03
问题 I'm kinda new to front end development, being a long time backend C# and Java developer, and I'm trying to come to grips with how to build front end applications. I would like to build an application using typescript and use gulp for my build pipeline to transpile, bundle and minify my code to a single JavaScript file. For this purpose, I have been looking at the node module tsproject which, as far as I can understand, is supposed to do exactly what I want. Except, I can't get it to do what I

Serve images dynamically with webpack

爱⌒轻易说出口 提交于 2019-12-11 02:08:23
问题 I have a question regarding webpack and serving images. I have a webpack config that build a React webapp and also serves .jpg files from a specific folder. But what happens if from my webapp I download and add a new image to this folder? Can I refresh webpack so that it will serve the new image and I will be able to import it with require.context ? Or, is it something that webpack is not supposed to do, and so I need to have this handled in the backend? Thanks, 回答1: This isn't something that

Why does a large enterprise-level implementation of ExtJs crash every browser? [closed]

泄露秘密 提交于 2019-12-11 02:02:57
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I are working on a implementation of ExtJs that I think is larger than its makers expected. Our pages instantiate over a 1000 ExtJs components. This first issue is that, most of the time, a single page load is

React toggle like button

僤鯓⒐⒋嵵緔 提交于 2019-12-11 00:14:51
问题 I have a component with a state: {likes: 123} I display the number of likes next to a 'like' button. How do I implement a functionality to this button, so when I click it once, it adds to likes (so state.likes = 124), then if I want to click it a second time it goes back to previous state (state.likes = 123). Of course, it displays the correct number of likes at all times. Here's what I've got so far: class ProfileInfo extends React.Component { constructor(props) { super(props); this.state =

Cannot read property 'match' of undefined error

二次信任 提交于 2019-12-10 23:48:05
问题 I am trying to display some text in React JS frontend in place of a profile image when it isn't available.Basically, I pass the current customer name to a function which extracts the first characters of all the words in the name. I am able to display just the name but when I do a function call, I get Cannot read property 'match' of undefined" error and the page does not render. Console.log() displays undefined. HTML: <li className="nav-item"> <div id="container_acronym"> <div id="name_acronym

GitHub API limit exceeded: how to increase the rate limit in front-end apps

拜拜、爱过 提交于 2019-12-10 23:31:53
问题 After some HTTP requests to the GitHub API, it starts refusing the calls saying: API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) Now, there is a way to increase the unauthenticated rate limit for OAuth applications which involves using the client secret . Of course we don't want to put or client secret on the public source code of a front-end app, as also the documentation

CMS editing scheme

﹥>﹥吖頭↗ 提交于 2019-12-10 16:05:21
问题 I'm just wondering if there is some scheme that is a proper way, proper steps of editing CMS like Wordpress, Joomla etc. By editing I mean css, javascript. The way I've been doing it so far is by creating files like custom.css and custom.js and then including them at the end of the head tags. Now I'm sure that my files has priority and would overwrite all existing rules. In my case it's obvious that we could deal with duplicate of code. Is this better way of thinking rather than editing

how to reload javascript file

我的未来我决定 提交于 2019-12-10 15:03:29
问题 I have a question about reloading JavaScript files. I develop web pages front-ends and do a lot of coding in JS. Every time when I want to check an application's flow is correct (or do some debugging) I have to hit F5 key to reload whole page and it's scripts, and I have to wait. Waiting time depends on page's weight and sometimes I get impatient. Therefore I wonder if there is any way to reload only changed script file *.js ? or maybe there is some plugin for Chrome to reload chosen script?

Vuetify external pagination not displaying page numbers

别来无恙 提交于 2019-12-10 14:34:51
问题 I have a v-data-table and I'm trying to add pagination to it. I've followed the example docs here I can't see what I'm doing wrong. When my component is created it makes a call to my backend to populate a list of items. Then this is passed to the data table. I also have a search bar and if I enter anything in it the page numbers pop up then. HTML <v-data-table :headers="headers" :items="incidents" :search="search" :pagination.sync="pagination" hide-actions class="elevation-1" item-key=

OnePlus 3 & Oneplus 5 viewport size for chrome Emulated Devices

喜欢而已 提交于 2019-12-10 14:09:51
问题 I wanted to add OnePlus 3 and OnePlus 5 as custom devices in the emulated devices list of Google Chrome. Please provide the viewport size so that I can test my website with it. Example for pixel 2 display dimentions Thanks in Advance 回答1: I was searching for the same thing and I found this: https://www.mydevice.io/ OnePlus 5: 455x809 , pixel ratio 2.375 , user agent Mozilla/5.0 (Linux; Android 8.1.0; Build/OPM1.171019.011) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile