-
Notifications
You must be signed in to change notification settings - Fork 0
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
Check that Web Bluetooth is available #223
Conversation
Bluetooth can be blocked by system policies.
Preview build will be at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't manage to test in iOS, but code-wise it looks good to me.
@@ -20,7 +20,7 @@ import { DeviceRequestStates } from '../microbit-interfacing/MicrobitConnection' | |||
let text: (key: string, vars?: object) => string; | |||
t.subscribe(t => (text = t)); | |||
|
|||
export const compatibility = writable<CompatibilityStatus>(checkCompatibility()); | |||
export const compatibility = writable<CompatibilityStatus>(await checkCompatibility()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How worried should I be that this has regressed browser compatibility by using top-level await?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very broken on Chrome 88:
Uncaught SyntaxError: Unexpected reserved word
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this a draft until resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have another one in i18n.ts:
await init({
fallbackLocale: 'en',
initialLocale: get(persistantLocale),
// Needed to format <link> style tags.
ignoreTag: false,
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already broken for Chrome 88 due to the await in i18n.ts. We'll come back to this later to attempt to target es2017 and lose both top-level awaits.
Bluetooth can be blocked by system policies and this additional check determines if this is the case.