Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playground: Consider simplifying by removing go-angularjs dependency. #64

Open
dmitshur opened this issue Feb 7, 2017 · 1 comment
Open
Labels

Comments

@dmitshur
Copy link
Member

dmitshur commented Feb 7, 2017

I see in neelance/go-angularjs@ae3e8ed that go-angularjs has been deprecated. /cc @neelance The playground currently uses it.

I've personally never liked having to go through Angular here, and wished the playground was written with basic events and DOM manipulation. I don't think Angular is very helpful for this application, and its non-idiomatic-Go API is cumbersome.

Is it okay to try to remove the dependency now and rewrite the playground to use plain DOM elements and events? Thoughts, opinions?

If this sounds like a good direction, I might give it a try and see if it leads to a better codebase or not.

dmitshur added a commit that referenced this issue Feb 17, 2017
Previous code would generate "$rootScope:inprog" AngularJS error (see
https://docs.angularjs.org/error/$rootScope/inprog).

I'm not fully sure what changed to cause that, but it seems this code
can now be executed synchronously without a goroutine (i.e., it makes
no blocking calls). According to AngularJS documentation (linked
above), that is one possible cause of this error:

> This error is often seen when interacting with an API that is
sometimes sync and sometimes async.

Perhaps something changed to cause formatting to no longer by
asynchronous.

Remove the goroutine and scope.Apply calls. It seems to work, but I'm
not familiar with AngularJS enough to be confident this is the best
thing to do. I'm also not sure what exactly changed to trigger the
original error.

Related to #64. Hopefully we can stop relying on AngularJS soon, and
this potential problem can go away/wouldn't have happened.
@neelance
Copy link
Member

I'm all for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants