Fork me on GitHub
#dirac
<
2016-03-01
>
darwin00:03:38

@jaen: I did some exploration of chromium sources and there is no flag which should prevent device discovery/functionality in dirac. It seems that all the functionality is implemented on “backend” side, and devtools just query it over the protocol. There should be no difference between remote or bundled.

darwin00:03:25

if you still have that diract setup, here is one thing you could try: 1) on <chrome://extensions> open Dirac DevTools options dialog and change it to open as a new window 2) open dirac 3) in the url you should see something like: replace it with just keep the ws parameter 4) you should see internal (bundled) devtools running in external window instead of Dirac devtools using remote debugging protocol (the panel highlighting underline is blue instead of green) 5) now you can test it again

darwin00:03:47

unfortunately I don’t have any android device, so I’m unable to test it here on my machine

jaen07:03:22

@darwin: I don't even have any smartphone, I just test with an emulator, Chrome picks that up as a normal device, so this should be testable w/it. I'll try what you say today and see if that helps.

darwin15:03:06

@jaen could you please point me to the emulator you are using? I’m not familiar with Cordova / Android development. Just tell me what to install so I can test it too

jaen15:03:08

Just the usual Android emulator from the SDK. You can find sample Cordova app here - https://github.com/enterlab/cordevicljs/

jaen15:03:25

After you install the Android SDK, create a VM with android avd and run it, Cordova should be able to deploy inside it when you do cordova run android.

darwin15:03:55

ok, thanks

darwin15:03:49

btw. what are you working on? just curious

jaen15:03:55

I don't think I can say much more apart from "a hybrid mobile application client for someone".

darwin15:03:37

hehe, hope it will be the next billion dollar app..

jaen15:03:07

Probably not that big, but the idea seems sound, so hopefully it takes off.

jaen15:03:53

Since you're here, is the 47 hard dependency for mobile formatters? I remember it working with older versions?

darwin15:03:23

mobile formatters?

darwin15:03:28

you mean custom formatters?

jaen15:03:06

Yes, of course I do

darwin15:03:04

that feature had some development over 3-4 months early in 2015, it was hidden behind experimental flag, so it was present, but wasn’t exposed

darwin15:03:30

it should be avail in 46 when you do some specific steps

jaen15:03:34

Yeah, I remember having to do the secret shift trick first time I used cljs-devtools.

darwin15:03:47

how old chrome do you target?

darwin15:03:59

if it is build after feb 2015, it should work

jaen15:03:43

I'd have to check again, think it was 44 or 45 that backs the webview in Cordova.

darwin15:03:52

see <chrome://version/>

darwin16:03:08

I’m trying to create a new emulated device via that android avd gui, but the target select box is empty, how do I get some targets?, I used brew install android-sdk

darwin16:03:46

ah, I got it, first I have to run android and install addtional stuff

jaen16:03:37

Yes, you have to install at least one API level in that SDK manager.

jaen16:03:53

Plus all the tools.

darwin16:03:08

I accepted the defaults, downloading

jaen16:03:50

Also, make sure you have the appropriate paths in PATH: /home/jaen/android-sdk-linux/tools:/home/jaen/android-sdk-linux/platform-tools/:/home/jaen/android-sdk-linux/build-tools

jaen16:03:04

It'll be of course somewhat different for a Mac, but probably the three same subdirectories

jaen16:03:39

Cordova didn't work for me at first until I realised I missed one of the subdirectories that contained adb I think.

jaen16:03:40

@darwin: just did what you described above and it doesn't work as well.

darwin16:03:03

ok, so it is not dirac, but really limitation in the protocol

jaen16:03:14

Yep, it appears so.

jaen16:03:17

BTW the user agent is: "Mozilla/5.0 (Linux; Android 6.0; Android SDK built for x86_64 Build/MASTER; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36"

jaen16:03:58

That's mid-2105

darwin16:03:38

so it should have formatters behind that shift trick

jaen16:03:17

cljs-devtools tests the user agent though, what do you think about a :skip-version-check parameter to the install function?

darwin16:03:16

it tests the version only for dirac feature

darwin16:03:23

not for custom formatters, I believe

darwin16:03:35

try calling (devtools/set-pref! :legacy-formatter true) before install! call

jaen16:03:14

You sure it doesn't test though?, I'm getting this: core.js:15 Feature 'custom-formatters' cannot be installed. Unsupported browser Mozilla/5.0 (Linux; Android 6.0; Android SDK built for x86_64 Build/MASTER; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36.

jaen16:03:22

I'll try that

darwin16:03:07

that message must be from Chrome or devtools itself, not from cljs-devtools

darwin16:03:38

you should be able to override that available? method to always return true

darwin16:03:10

from the top of my head: (set! js/devtools.custom_formatters “available_QMARK_" (constantly true))

darwin16:03:37

maybe there is a better way how redefine dynamic var

jaen16:03:11

I'm not sure there is, that should do the trick, let me check

jaen16:03:20

Well, it does skip the check, but they don't seem to be working unfortunately. Thanks for the help though!

darwin16:03:54

did you enable them in the settings? did you set the legacy formatter option?

darwin16:03:19

also be sure you refresh whole devtools by closing it and opening again

darwin16:03:37

that setting for enabling them acted weirdly in old versions

jaen16:03:05

Yes, I remember all that, been using cljs-devtools back then too. It just seems there's no options in settings for that when I open device inspector.

darwin16:03:00

I don’t know what is device inspector, you need to open devtools -> settings (F1)

darwin16:03:55

btw. I was able to use custom formatters in pretty old Electron build (in Atom editor) back in Aug

darwin16:03:18

that is why I have that :legacy-formatter option there

jaen16:03:52

I'm not sure what it's called, it's what happens when you do More tools -> Inspect Device… then choose the device and click Inspect

darwin16:03:36

ok, maybe you have slightly incompatible devtools with the “backend” running in the phone

darwin16:03:43

so your devtools have enabled custom formatters in settings, right?

jaen16:03:04

those embedded in Chrome do, yes

jaen16:03:10

I suppose it's either another limitation of the devtools when they are not embedded.

jaen16:03:19

Or maybe 44 is just too old.

darwin16:03:45

remote devtools work with custom formatters (dirac is an example)

darwin16:03:07

you should try to refresh the page in the phone after you connect the devtools, that custom formatter enabling switch has to propagate somehow to the “backend"

jaen16:03:44

Yeah, but the "inspect" devtools don't have option to enable them, so maybe it's just something that's not supported either in 44 or when inspecting a device.

darwin16:03:22

ah, maybe 44 was release in Aug 2015, but it actually compiled much older code, let me see

jaen16:03:25

I think I remember using formatters with 43

jaen16:03:38

But that was with the mash-shift-trick

jaen16:03:53

And those devtools don't even have "experiments" option tab.

jaen16:03:03

So I guess I'm just out of luck

darwin16:03:36

I’m trying to figure out what exact version of code was compile in there. I think you could try to use older devtools build. Download chrome 44 and try to enable custom formatters there

darwin16:03:58

I think matching version of chrome-devtools and remote backend has higher chance of success.

darwin16:03:28

also if you don’t find custom formatters option there (after that shift trick), it means it is probably not yet avail

jaen16:03:16

Yeah, I'll try that later; though probably I'll have to accept that debugging a hybrid app won't be as nice as debugging a web app after all.

jaen16:03:42

I'm curious if it would be better with React Native or not, but I don't have anything to test that with ATM.

darwin16:03:03

the support for CFs is just a question of time, until Android decides to include more recent version of Chrome

jaen16:03:39

Yeah, but I'm running 6.0 in the emulator and it reports as 44, so it'll probably be a while yet.

darwin16:03:51

there could be a way to update it maybe?

jaen17:03:27

The emulator doesn't seem to have Google Play but I'll keep experimenting, thanks for the pointers

jaen17:03:00

The group (https://plus.google.com/communities/105434725573080290360) says it's currently 49 so if I get the store working it might be helpful

darwin17:03:19

your employer should buy you a nice new phone, I think 😉

jaen17:03:17

I'll be getting one in a week or so, but if I can figure it out before that - why not try; I'll know what to do when I get a real phone.