Will aurelia-fetch support polyfill? - fetch

Is there a plan to add polyfill support to the aurelia-fetch module, and if so when will it become available? We started with this module but now realize that Safari doesn't have support for fetch yet (except in the tech preview version), so I thought I'd check before changing to whatwg-fetch or fetch.

No need to use fetch polyfill directly. Just include some polyfill like GitHub fetch in addition to aurelia-fetch-client.
If you are using jspm, then jspm install fetch and add import to main module:
import 'fetch';
After that, you can use aurelia-fetch-client with all browsers. More info in documentation hub.
Also, as Daniel mentioned in comment, once the browser adoption is better, you can just remove polyfill without affecting the application.

Related

Next.js Is there a way to have built in css-sass enabled while adding less configuration?

I want to use the css/sass built-in feature in Next.js while I want to add less configuration.
The css/sass built-in is fine but as soon as I add less to next.config.js, it disables the feature so I have to configure them like before one bye one using:
#zeit/next-sass
#zeit/next-less
#zeit/next-css
Is there a way to keep the feature enable while adding just less config?
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected. after adding less configuration!
Next.js disables all built-in CSS support if you have any custom CSS preprocessor.
So, if you add a custom plugin to process Less and need support for CSS and Sass, you would have to setup those plugins as well.
Next.js webpack config source code

Reference error: Can't find variable: IntersectionObserver

I'm trying to use IntersectionObserver in cordova 8.0.0 app which is running on ios 13. When I inspect my app via safari, I see an error on intialization:
ReferenceError: Can't find variable: IntersectionObserver
This would suggest, that IntersectionObserver is not available, and I should use a polyfill. But! I've read many post claiming that IntersectionObserver is nativly supported in iOS safari 12+. And I kinda assume, that cordova would be running nativly available WKWebView, so it should work without polyfill, right?
I've found that I've got IntersectionObserver enabled in my safari experimental features, so maybe there is an option/flag I could use to force enable this feature in my app as well? I'd really like to avoid using polyfill if it's possible..
Thx to any suggestions
We ran into this issue and there is one important thing to call out. While this has been fixed in newer Safari Browsers, this issue still can occur on older devices (despite fully updated Safari). This is due to the fact that the IntersectionObserver feature seems to be deactivated as 'Experimental feature' on older iPhones (I know for fact that this is the case for iPhone 8) - possibly to save resources - see https://youtu.be/qDSXYGybNVU?t=68. So to ensure your application to work you might need to use polyfill as an alternative/fallback nevertheless.
IntersectionObserver API is supported on iOS safari since 12.2. Yet it was supported via 'experimental feature' and enabled by default. I assume that experimental features are not enabled under cordova by default, so far I haven't found a way to configure it to be enabled.
An option is to use polyfill: https://www.npmjs.com/package/intersection-observer. I tested myself and performance is not good enough, it uses either setTimeout or MutationObserver to observe whole document with all options enabled.
I just added this checking
if ('IntersectionObserver' in window) {
// IntersectionObserver initialization code
} else {
// make lazy loading elements to be loaded right away
}
Enjoy

React. How to add autoprefixer package in and config it?

I search over the whole internet and do not find an answer on the question - how I can add the vendor prefixes support for my css files on production build?
So, I found two articles on this question, but it does not help me `.
https://medium.com/#kitze/configure-create-react-app-without-ejecting-d8450e96196a
https://medium.com/#ruanjian/configure-css-for-create-react-app-8681c6eb5f00
You don't need to use any vendor prefixes if you have created your React app by the script create-react-app, it does use autoprefixer.

What Javascript engine is used by Paw?

I've been trying my hand at writing some code generator extensions. Using "regular" Javascript these work fine so I decided to up the ante and convert them to ES2015 and/or TypeScript based projects. However the transpiled code cannot always be registered as a Paw extension. So this got me wondering: what Javascript engine is actually running under the hood? Should it be able to talk native ES6 code? Is this planned?
Paw links against Apple's official JavaScript Core framework, as it can be found in:
/System/Library/Frameworks/JavaScriptCore.framework/
And Safari is also linked against it. You can find the actual jsc binary here:
/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc
It sounds like all ECMA-262 (=ES2015) tests pass except promises: test262/CONSOLE-RUNNER.md
My guess is as features are added on Safari, at each OS upgrade, they are also added to the JavaScript Core framework. So the exact ECMA compatibility probably depends on the OS version.

Does CEF3 support NaCl?

Has anyone had success in enabling NaCl/PNaCl support in the CEF3 (Chromium Embedded Framework)?
I find that Chrome (34) can run the PNaCl samples on this page fine, but the cefclient distributed at cefbuilds.com (Windows, 1916 branch) does not.
Chrome lists the ppGoogleNaClPluginChrome.dll as a PPAPI (in-process) plugin on chrome://plugins, while the cefclient app doesn't have this plugin listed (Test/Plugins menu option)
I've pulled down the source, and don't see any NaCl depedencies for the libcef target, and also see this issue filed for the CEF project, which make me suspect that this is currently only available for Chromium/Chrome.
--- Update ---
There has been quite a bit of activity on this question recently, I suspect in part due to the bounty, and also because Chrome/Chromium is now actively deprecating NPAPI.
If you would like to encourage the CEF team to prioritize work on adding NaCl/PNaCl support, please vote for the issue here:
http://bitbucket.org/chromiumembedded/cef/issue/705#
From the CEF Forum:
CEF does not include the NaCl pepper (ppapi) plugin which is required to load NaCl applications. So you need to tell CEF where to find the NaCl plugin via the command-line. I'm not sure of the exact command-line, but you can use this as a guide: viewtopic.php?f=10&t=10509
You can get the plugin from an equivalent version of Google Chrome of you can build it from source code. For more information see http://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics.
I haven't tested NaCl support in CEF myself so it's possible that other changes may be required.
In 2017 June, CEF3's plan to eventually suport NACL was officially dropped as mentioned in https://bitbucket.org/chromiumembedded/cef/issue/705
This is due to chromium moving to replace NACL by Webassembly.
There's some work in CEF3 in that direction: accordingly to https://bitbucket.org/chromiumembedded/cef/issues/2101/add-webassembly-support there's wasm support in v8 engine and it can be enabled by specific flags.

Resources