fazo96 / ipfs-boards

a truly distributed social platform for the browser with no backend and no external applications required
http://boards.ydns.eu
220 stars 20 forks source link

Browser compatibility #63

Closed fazo96 closed 6 years ago

fazo96 commented 8 years ago

Here we discuss browser compatibility:

Started from a discussion in another issue

kustomzone commented 8 years ago

Thanks. (testing on Win7) Atm, the compatibility issues center mainly around ES6 (2015) ie. unknown syntax. Fwiw, not working Maxthon (Chinese browser) Ver. 4.4.8 (core is IE11.0 + webkit.dll) Also a syntax error on FF42.

Working in Chrome 46, Opera 34, FF 45 (nightly)

Cheers!

fazo96 commented 8 years ago

That's weird, it's working well for me on firefox 42 on arch linux.

jbenet commented 8 years ago

could setup a thing to take screenshots across browsers per PR. might be too much work for now

fazo96 commented 8 years ago

Maybe other than write unit tests for the Boards API ( #3 ) we should also set up tests for the UI if it's possible, then use Karma or something to run them across browsers.

Should investigate this

kustomzone commented 8 years ago

"let expression support has been dropped in Gecko 41" (bug) "let blocks support has been dropped in Gecko 44" (bug)

Can I use let and const now?

"Yes. To use them on the web, you’ll have to use an ES6 compiler such as Babel, Traceur, or TypeScript. (Babel and Traceur do not support the temporal dead zone yet.)"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let

fazo96 commented 8 years ago

uhm there should not be any let statements in the compiled code. @kustomzone may I ask how are you trying the app? Firefox 42 on my machine makes no complaint and runs the compiled app flawlessly. I can't understand why on my machine it doesn't complain about let (as expected, since there should be no let statements).

kustomzone commented 8 years ago

Ah, that could be the answer. I had problems with backslash paths (windoze), and couldn't quickly resolve where the chunks we being declared (also for some reason webpack is putting the chunk numbers on the front eg 1.app.js) so i temporarily disabled ulglify (optimize) which also speeds the build locally. And declared 1 chunk max to get it running.

fazo96 commented 8 years ago

@kustomzone are you using windows? Maybe something in the build doesn't play nice with Windows, I haven't tried

kustomzone commented 8 years ago

Yes. When webpack chunks the scripts the path gets declared statically, and of course that's resolved to IPFS (why i asked about mount, thanks for explaining) so i bootstrap it by calling "dist%5Capp.js" and disabled chunking. (edited previous comment)

fazo96 commented 8 years ago

Wow, thanks a lot for this!

It'd be great if you could manage to get it to work on windows with uglify and on linux/osx too with the same code. I'd very happily merge a PR about that :+1:

kustomzone commented 8 years ago

I'm also new to webpack, react, babel, but an OS check in the build process shouldn't be too hard to do. (i lost my linux laptop, so stuck on win7 pc for now)

fazo96 commented 8 years ago

Yeah I've seen a few scripts do it :+1:

If I have the time, I'll try to set it up on windows and fix it myself, but contributions are welcome. I'll open an issue about windows support so that we can continue discussing there :+1:

kustomzone commented 8 years ago

Thanks. Orbit (renaming topic) has a "Requirements" section in readme. Could mention OS or browser until we've verified or resolved them. (i added it to FAQ on my branch while i test)

fazo96 commented 8 years ago

Yeah we should add a FAQ entry about the OS and one about the Browser, also in CONTRIBUTING.md we should mention that development is happening on Linux + Chromium.

If you are comfortable with doing it, I'll gladly accept a PR, but if you're not I'll do it myself :+1:

fazo96 commented 8 years ago

@jbenet

could setup a thing to take screenshots across browsers per PR. might be too much work for now

You mean something that opens the app in multiple browser and takes screenshots? Maybe we should have very simple tests that run in the browser: they wouldn't catch big mistakes but they would catch errors in the build and incompatible code :+1:

Related: #3 #73

jbenet commented 8 years ago

could hook it up to CI + ipfs.io gateway +

fazo96 commented 8 years ago

wow thanks @jbenet! I didn't even know about those services.