dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
2016-03-01T00:02:38.000257Z

@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.

2016-03-01T00:07:25.000258Z

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: <chrome-extension://mjdnckdilfjoenmikegbbenflgjcmbid/devtools/front_end/inspector.html?dirac_flags=11111&amp;ws=localhost:9222/devtools/page/7594DED5-9206-448A-8D64-6C4A93149F1C> replace it with <chrome-devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/page/7594DED5-9206-448A-8D64-6C4A93149F1C> 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

2016-03-01T00:07:47.000259Z

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

jaen 2016-03-01T07:09:22.000261Z

@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.

2016-03-01T15:01:06.000262Z

@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

jaen 2016-03-01T15:47:08.000263Z

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

jaen 2016-03-01T15:49:25.000266Z

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.

2016-03-01T15:49:55.000267Z

ok, thanks

2016-03-01T15:50:49.000268Z

btw. what are you working on? just curious

jaen 2016-03-01T15:51:55.000269Z

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

2016-03-01T15:52:37.000270Z

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

2016-03-01T15:52:44.000271Z

:simple_smile:

jaen 2016-03-01T15:53:07.000272Z

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

jaen 2016-03-01T15:54:53.000273Z

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

2016-03-01T15:55:23.000274Z

mobile formatters?

2016-03-01T15:55:28.000275Z

you mean custom formatters?

jaen 2016-03-01T15:56:02.000276Z

jaen 2016-03-01T15:56:06.000277Z

Yes, of course I do

jaen 2016-03-01T15:56:08.000278Z

Sorry

2016-03-01T15:57:04.000279Z

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

2016-03-01T15:57:30.000280Z

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

jaen 2016-03-01T15:57:34.000281Z

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

2016-03-01T15:57:47.000282Z

how old chrome do you target?

2016-03-01T15:57:59.000283Z

if it is build after feb 2015, it should work

jaen 2016-03-01T15:58:43.000285Z

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

2016-03-01T15:58:52.000286Z

see <chrome://version/>

2016-03-01T16:02:08.000287Z

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

2016-03-01T16:03:46.000290Z

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

jaen 2016-03-01T16:04:37.000291Z

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

jaen 2016-03-01T16:04:53.000292Z

Plus all the tools.

2016-03-01T16:05:08.000293Z

I accepted the defaults, downloading

jaen 2016-03-01T16:05:50.000294Z

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

jaen 2016-03-01T16:06:04.000295Z

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

jaen 2016-03-01T16:06:39.000296Z

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

jaen 2016-03-01T16:08:40.000297Z

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

2016-03-01T16:09:03.000298Z

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

jaen 2016-03-01T16:09:14.000299Z

Yep, it appears so.

jaen 2016-03-01T16:10:17.000300Z

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"

jaen 2016-03-01T16:10:58.000301Z

That's mid-2105

2016-03-01T16:11:38.000303Z

so it should have formatters behind that shift trick

jaen 2016-03-01T16:13:17.000304Z

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

2016-03-01T16:14:16.000305Z

it tests the version only for dirac feature

2016-03-01T16:14:23.000306Z

not for custom formatters, I believe

2016-03-01T16:14:35.000307Z

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

jaen 2016-03-01T16:15:14.000308Z

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.

jaen 2016-03-01T16:15:22.000309Z

I'll try that

2016-03-01T16:16:07.000310Z

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

2016-03-01T16:16:23.000311Z

wait

2016-03-01T16:17:08.000312Z

you are right I do check for it here: https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/custom_formatters.cljs#L13

2016-03-01T16:17:38.000314Z

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

2016-03-01T16:19:10.000316Z

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

2016-03-01T16:19:37.000318Z

maybe there is a better way how redefine dynamic var

jaen 2016-03-01T16:20:11.000320Z

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

jaen 2016-03-01T16:32:20.000321Z

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

2016-03-01T16:32:54.000322Z

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

2016-03-01T16:33:19.000323Z

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

2016-03-01T16:33:37.000324Z

that setting for enabling them acted weirdly in old versions

jaen 2016-03-01T16:34:05.000325Z

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.

2016-03-01T16:35:00.000327Z

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

2016-03-01T16:35:55.000328Z

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

2016-03-01T16:36:18.000329Z

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

jaen 2016-03-01T16:36:52.000330Z

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

2016-03-01T16:38:36.000331Z

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

2016-03-01T16:39:43.000332Z

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

jaen 2016-03-01T16:41:04.000333Z

those embedded in Chrome do, yes

jaen 2016-03-01T16:42:10.000334Z

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

jaen 2016-03-01T16:42:19.000335Z

Or maybe 44 is just too old.

2016-03-01T16:42:45.000336Z

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

2016-03-01T16:43:07.000337Z

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"

jaen 2016-03-01T16:43:44.000338Z

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.

2016-03-01T16:44:22.000339Z

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

jaen 2016-03-01T16:45:25.000340Z

I think I remember using formatters with 43

jaen 2016-03-01T16:45:38.000341Z

But that was with the mash-shift-trick

jaen 2016-03-01T16:45:53.000342Z

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

jaen 2016-03-01T16:46:03.000344Z

So I guess I'm just out of luck

2016-03-01T16:52:36.000345Z

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

2016-03-01T16:52:58.000346Z

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

2016-03-01T16:53:28.000347Z

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

jaen 2016-03-01T16:54:16.000348Z

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.

jaen 2016-03-01T16:54:42.000349Z

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

2016-03-01T16:55:03.000350Z

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

jaen 2016-03-01T16:56:39.000351Z

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

2016-03-01T16:59:51.000353Z

there could be a way to update it maybe?

2016-03-01T17:00:49.000354Z

maybe try this inside the phone? http://android-developers.blogspot.cz/2015/02/beta-channel-for-android-webview.html

jaen 2016-03-01T17:09:27.000355Z

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

jaen 2016-03-01T17:10:00.000356Z

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

2016-03-01T17:10:19.000359Z

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

jaen 2016-03-01T17:11:17.000360Z

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.