proxy-www
javascript
proxy-www | javascript | |
---|---|---|
5 | 133 | |
884 | 141,987 | |
- | 0.7% | |
0.0 | 6.5 | |
about 3 years ago | 10 days ago | |
JavaScript | JavaScript | |
The Unlicense | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proxy-www
-
Four examples of strange ways to bind HTML to nested objects that contain writable stores!
I have eliminated the need for stores in my tree by using proxies, my original little component inventions are very efficient a value changes in a store, I assign it to innerHtml. A store is just a nerfed emitter, it is a tiny little useful program. I don't know what svelte does, when it detects a change to a large nested tree. Does it re-render the whole thing, does it do dom or object, or both diffing, I am not sure. It should observe changes on a property level, like spreadsheet programs. But, browsers, diffing, shadow DOMs and computers are fast today, so as I was going over the twisty litte passages, I also rewrote my tree. In a really crazy way, and you really need to know about this, because when you use Object proxies, then svelte becomes ideal for nested objects. Let me show you how proxies work: https://github.com/justjavac/proxy-www This brilliant person made a www object, that is a proxy, meaning he can intercept the next property. in this case www.baidu, and return a proxy again to capture the data, which in this case is .com when .then is called. It then makes a request to www.baidu.com www.baidu.com.then(response => { console.log(response.status); // ==> 200 }) THIS TYPE OF REFERENCING MAKES SVELTE DEEPLY HAPPY, when the www is a variable that you are referencing in the DOM. Let's go to my tree now. tree is an instance of a normal Tree class, it has children, element, thype of stuff. But I also gave it a proxy... the read property is a proxy that will return a node this way: tree.read.abc.context.filename tree.read is a getter, that returns a proxy. that will spy on the next thing after the dot, in this case abc, which is a node id. it will grab that node and return it, for binding via bind: here I bind to context.filename, but I could bind to tree.read.abc.name which is a lable for the node. filename: {tree.read.abc.context.filename} input.name: THIS ACTUALLY WORKS tree.read.abc.name = 'Hello World', will re-render the UI. Because SVELTE does not care that read is a proxy, it only sees assignment to tree.something.something.something.something It does not care that .read.abc is not real data, though it returns the node object, it is not where the object really is. --- I think we have reached the limit of being able to communicate ideas, my concluding thought is: No, svelte does not not turn a nested object into nested writables, but it is OK, because simplicity has its benefits too. We can lie that tree.read.abc or even ($tree.read.abc if via import) is where out data is at, and say thing like tree.read.abc.name = 'Hello World', to really kick bubble gum. The store ends at your object bounday though it does not go inside, all the properties within are just nested POJO properties, BUT, svelte will detect changes anyway, so as long as you clearly refer to the ROOT object. In my case tree. in your case $data. One last thing to underline, between us noobs, you use stores when you can't bind:data for some reason. The store pipeline, is to be used, when you can't bind easily. Learn to use the proxies, they are of JavaScript not svelte, but they let you bind very deeply into complex data structures, and make an assignment, which svelte will then notice, and re-render the UI. Good luck, here is your program without stores, you don't need to use them if you don't need them: https://svelte.dev/repl/21f8cc38cf3e4b64b824d7c7b702d17b?version=3.44.3
-
Cool ES6 Proxy Hacks
Coming across this creative approach of using fetch, I was wondering in what cool ways you folks take advantage of JavaScript ES6 Proxies?
-
🧢 Stefan's Web Weekly #21
👉 Inspect the www proxy
- ES6 and Proxy to Implement “Www”
- proxy-www
javascript
-
Mastering Code Quality: Setting Up ESLint with Standard JS in TypeScript Projects
You may be torn between those famous code styles, struggling to choose one between Airbnb JavaScript Style, Google JavaScript Style Guide, JavaScript Standard Style, or XO, among others.
-
Decoding JavaScript Variables: A Comprehensive Overview
// Follow Established Style Guides // Adhere to established style guides such as Airbnb JavaScript Style Guide or Google JavaScript Style Guide to maintain consistency across your codebase. // These style guides provide comprehensive rules and recommendations for variable naming, declaration, and usage. // Example: Airbnb JavaScript Style Guide // https://github.com/airbnb/javascript /** * Represents a person with a given name and age. * @typedef {Object} Person * @property {string} name - The name of the person. * @property {number} age - The age of the person. */ /** * Create a new person. * @param {string} name - The name of the person. * @param {number} age - The age of the person. * @returns {Person} - The newly created person object. */ function createPerson(name, age) { return { name, age }; } const person1 = createPerson("John", 30); const person2 = createPerson("Jane", 25); console.log(person1); console.log(person2);
-
10 GitHub Repos for Mastering JavaScript
Repository: airbnb/javascript
- Airbnb JavaScript Style Guide
-
How, and why, you should add JavaScript linting to your project. With ESLint and Gulp
Instead of writing our own exhaustive list of JavaScript rules, we can use a ruleset defined by the developers at Airbnb, and then adjust it to suit our preferences. The Airbnb JavaScript Style Guide is well known among JavaScript developers and used by some big companies: Lonely Planet, National Geographic and Sainsburys to name a few. It’s a great place to start.
-
Linting
Airbnb Style Guide
-
Eslint & Prettier Configuration React Native(Airbnb Style)
# question 1: ? How would you like to use ESLint? … To check syntax only To check syntax and find problems ❯ To check syntax, find problems, and enforce code style # question 2: ? What type of modules does your project use? … ❯ JavaScript modules (import/export) CommonJS (require/exports) None of these # question 3: ? Which framework does your project use? … ❯ React Vue.js None of these # question 4 (select "No", because we won't add TypeScript support for this project): ? Does your project use TypeScript? › No / Yes # question 5: ? Where does your code run? … Browser ✔ Node # question 6: ? How would you like to define a style for your project? … ❯ Use a popular style guide Answer questions about your style Inspect your JavaScript file(s) # question 7 (we'll rely on Airbnb's JavaScript style guide here): ? Which style guide do you want to follow? … ❯ Airbnb: https://github.com/airbnb/javascript Standard: https://github.com/standard/standard Google: https://github.com/google/eslint-config-google # question 8: ? What format do you want your config file to be in? … JavaScript YAML ❯ JSON # the final prompt here is where eslint will ask you if you want to install all the necessary dependencies. Select "Yes" and hit enter: Checking peerDependencies of eslint-config-airbnb@latest The config that you have selected requires the following dependencies: eslint-plugin-react@^7.21.5 eslint-config-airbnb@latest eslint@^5.16.0 || ^6.8.0 || ^7.2.0 eslint-plugin-import@^2.22.1 eslint-plugin-jsx-a11y@^6.4.1 eslint-plugin-react-hooks@^4 || ^3 || ^2.3.0 || ^1.7.0 ? Would you like to install them now with npm? › No / Yes
-
Linting Unveiled: Elevating Code Quality and Consistency
Extensible : ESLint supports the use of plugins and custom rules, enabling you to extend its functionality to suit your project requirements. Notably, there are popular ESLint plugins that align with well-established coding standards and styles. Examples include Airbnb JS Style Guide and Google JS Style Guide.
-
The Best ESLint Rules for React Projects
An obvious pick for React projects, but eslint-plugin-react along with their plugin:react/recommended rule set is a must. This will give you some sensible rules such as requiring a key to be specified in JSX arrays. eslint-config-airbnb is another good (if a bit loose) base rule set on top of eslint-plugin-react to start from.
- 21 Best Practices for a Clean React Project
What are some alternatives?
boring-avatars - Boring avatars is a tiny JavaScript React library that generates custom, SVG-based avatars from any username and color palette.
eslint-config-xo - ESLint shareable config for XO
Tsunami - An official Fog Network proxy site, made to access the blocked web. Surf without web filters or restrictions. Made with style, Tsunami is a rather fancy service dedicated to protecting your freedom from censorship
daisyui - 🌼 🌼 🌼 🌼 🌼 The most popular, free and open-source Tailwind CSS component library
utterances - :crystal_ball: A lightweight comments widget built on GitHub issues
33-js-concepts - 📜 33 JavaScript concepts every developer should know.
Ultraviolet - A highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers. Works by intercepting HTTP requests with a service worker script that follows the TompHTTP specifications.
eslint-config-google - ESLint shareable config for the Google JavaScript style guide
You-Dont-Know-JS - A book series on JavaScript. @YDKJS on twitter.
missing-semester - The Missing Semester of Your CS Education 📚
ical-js-parser - Simple iCal parser for JavaScript from string to JSON and vice versa.
eslint-plugin-react - React-specific linting rules for ESLint