Comments (16)
Realistically I should just remove the angular dependency, such that all gun example apps in the gun repo are just plain JS.
I do want common library/framework examples but I do not want to have to bundle their source code in our repo.
So the option is have some default examples with existing frameworks in the gun repo (which would be nice) but rely on a CDN which causes issues while offline. Or remove those examples entirely to another repo.
Ideally I want neither. Any clever alternative?
from gun.
Make a repo for each example that is batteries included.
—
Sent from Mailbox
On Wed, May 13, 2015 at 10:19 PM, Mark Nadal [email protected]
wrote:
Realistically I should just remove the angular dependency, such that all gun example apps in the gun repo are just plain JS.
I do want common library/framework examples but I do not want to have to bundle their source code in our repo.
So the option is have some default examples with existing frameworks in the gun repo (which would be nice) but rely on a CDN which causes issues while offline. Or remove those examples entirely to another repo.Ideally I want neither. Any clever alternative?
Reply to this email directly or view it on GitHub:
#51 (comment)
from gun.
Or just use package.json and bower.json in each example folder so after npm install and bower install the stuff is downloaded.
—
Sent from Mailbox
On Thu, May 14, 2015 at 9:15 AM, AJ ONeal (Home) [email protected]
wrote:
Make a repo for each example that is batteries included.
—
Sent from Mailbox
On Wed, May 13, 2015 at 10:19 PM, Mark Nadal [email protected]
wrote:Realistically I should just remove the angular dependency, such that all gun example apps in the gun repo are just plain JS.
I do want common library/framework examples but I do not want to have to bundle their source code in our repo.
So the option is have some default examples with existing frameworks in the gun repo (which would be nice) but rely on a CDN which causes issues while offline. Or remove those examples entirely to another repo.Ideally I want neither. Any clever alternative?
Reply to this email directly or view it on GitHub:
#51 (comment)
from gun.
BTWs it's not possible to use just JavaScript since JavaScript has no way to do file access or http access. You end up having to use jquery or angular if you want to use just JavaScript since they shim the DOM to return proper native JavaScript objects instead of C++ and Java linked objects that aren't compatible with native JavaScript functions.
from gun.
@coolaj86 what does that mean?
from gun.
What does which mean?
from gun.
BTWs it's not possible to use just JavaScript since JavaScript has no way to do file access or http access. You end up having to use jquery or angular if you want to use just JavaScript since the shim the Dom to return proper native JavaScript objects instead of C++ and Java linked objects that aren't compatible with native JavaScript functions.
What can't you just use JavaScript for? Also, where are C++ or Java involved in including or not including Angular in anything?
from gun.
There's this whole hipster bs lately about "vanilla js", but "vanilla js" would mean proper ES5 "use strict";
, Promise
s instead of callback hacks, etc.
But even with that, JavaScript still doesn't have any way to do web requests. JavaScript does not have a way to set a timeout or interval. JavaScript doesn't have a way to access a file system. JavaScript has no native I/O capabilities and no built-in asynchronous routines (other than Promise).
When you use the DOM (think of the inappropriately named XMLHttpRequest) you're accessing C++ (Chrome, Firefox), Java (some embedded browsers), or C# (Trident / MSIE) and exposing incompatible objects through a binding layer.
For example, have you ever tried calling JSON.stringify(ev)
on a click event? It gives you a non-javascript DOM-bound event object that can't properly be stringified. Or how about using JS-native Array methods on a DOMList (think querySelectorAll).
Any time you run console.log(foo)
(console is NOT "vanilla js", btw) and you see function [Native Code]
as the output, you're not using "vanilla js".
The reason that we have jQuery and Angular is that the developers who created the DOM decided to use crappy wrapper objects instead of exposing them as "vanilla js". Libraries like jQuery and Angular copy or wrap the non-javascript objects with actual javascript objects so that you can use them more easily in your code.
When you use node, the story is a little better. For the most part all of the node bindings to C++ actually return real "vanilla js" objects. In fact, as much as I can recall, node doesn't return any objects or expose any public APIs except for "vanilla js".
If you did, however, really want "vanilla js" for the dom there are two libraries (react and jsdom) which will do so.
So "plain js" and "vanilla js" are a ruse. They are completely useless and the best we can do is to use the non-js apis that we are forced to use and wrap them such that they expose "vanilla js" to us.
from gun.
Okay, but what does that have to do with including Angular in the example app?
from gun.
- You don't need to include angular in the repo. Just use bower.
- Angular objects and functions are "vanilla js". They are much much more "vanilla js" than the DOM.
from gun.
I see what you're getting at, although I'm not sure it's really fair to say that using the DOM isn't "vanilla js" since pretty much anyone working with JavaScript is doing it in a web browser with the end goal of manipulating the DOM (unless you're using Node, of course), especially considering those other libraries are really only wrapping the same underlying code that you could use yourself. But that's neither here nor there.
@amark I think that @coolaj86's suggestion of breaking examples out into separate repos is the best option. I'm still on board to make an Ember package/demo now that I have time.
from gun.
oh my, that was a hilarious tangent. Thanks for the entertainment.
@alexlafroscia yeah, I still want some examples bundled with the repo just so it is easy for people to try things out in one go. But you're right, any examples that start using popular external tools should probably be broken out into their own project. Plus then we can make those ones look "pretty" too, such that they focus on the aesthetics of gun powered apps while the bundled ones would be super simple microscopic apps that are easy to fiddle around with, understand, and get started with.
An Ember demo would be great! Although warning: our next release of GUN will have a lot of breaking changes and finally have support for tables and stuff. So be prepared for things to change.
from gun.
@amark Any idea when that's coming? If it's that different, I'd probably be better off just waiting until it has been released. Maybe we can chat on Gitter about what the best way to approach that is.
from gun.
@alexlafroscia I just started coding again, so I'm not sure how long. :(
The internals are changing a bunch, but how you USE gun stays the same, with the EXCEPTION of some API renaming:
.get
will be renamed to.val
.load
will be renamed to.get
.set
will be renamed to.put
.all
will be introduced.
Are the major things, some minor details like .blank
is being renamed .not
or maybe depreciated.
Yes, hit me up on the gitter whenever you want. It is up to you whether you want to wait or not, I don't blame you if you'd rather hold off.
from gun.
Broken into #79 which resolves the immediate issue. Now this issue is about splitting an angular app into its own seed project repo that we put up on github.
from gun.
We have some starter app examples using different popular frameworks here or listed here: https://github.com/gundb/gun-starter-app
I didn't see Angular specifically mentioned yet. But I'm gonna say that that should be the reference point, not gun core anymore - we want gun core issues to be about "bugs" to help people understand potential existing flaws. With that, gonna close! I hope that is okay.
from gun.
Related Issues (20)
- are there any recipies how to model data structures properly for Gun? HOT 1
- [Doc] user example is wrong? HOT 2
- [Doc] how can one find the root node of a given user? HOT 2
- [Doc] how can one write encrypted data? HOT 2
- [Doc] is the SEA Quickstart example wrong? HOT 3
- [RAD] I'm completely lost... HOT 9
- If you put data in a key with one gun instance, then change that data on another gun instance, the first instance will be unable to read the change HOT 5
- Unable to use Array.push inside once() HOT 1
- Loading sea.js with importScripts fails in worker HOT 6
- [Bug] _ev.off() disables the entire .map() listener, rather than the individual item HOT 1
- Silent Failure on Incorrect Certificate and Delayed put HOT 1
- How to deploy gun server by Docker? HOT 4
- [Question] Netx.js support? HOT 1
- Why is the source code so bad? HOT 2
- Can not access docs HOT 2
- load() issue HOT 2
- Gun integration with express not working HOT 3
- Once dosen't trigger most of the time, when messages are authenticated to an user. HOT 1
- Gun not working with next.js 14.0.4 HOT 9
- Gun reports all documents always not only changed ones
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 gun.