-
Notifications
You must be signed in to change notification settings - Fork 26
Framework Compatibility
Ryan Johnson edited this page Sep 24, 2018
·
20 revisions
Even though HelixUI strives to remain platform-agnostic, we also want to build functionality in a way that provides the least resistance for integration into a consumer's technology stack. As such, you should avoid implementing any business logic into new functionality (no API calls, no permission/authorization logic, no URLs, etc.).
The frameworks we aim for the most compatibility are:
- Vanilla HTML (i.e., no framework)
- Angular 1.x
- React 15+
- VueJS 2.x
Keep reading to learn more about framework compatibility issues and strategies to correct or work around them.
(a.k.a. No framework)
- Be aware of built-in methods and properties of HTMLElement and its prototype chain.
- Node ← Element ← HTMLElement
TBD
If you want use @angular/cli
to bootstrap your application, you'll need to make sure to do the following to ensure maximum compatibility with HelixUI.
- copy
node_modules/helix-ui/
assets tosrc/assets/helix-ui/
- copy
node_modules/@webcomponents/webcomponentsjs/
assets tosrc/assets/webcomponentsjs/
- update
src/index.html
contents with official Helix layout markup - make sure
<link>
and<scripts>
insrc/index.html
point to files insrc/assets/helix-ui
andsrc/assets/webcomponentsjs
- add
CUSTOM_ELEMENTS_SCHEMA
to the list of schemas insrc/app/app.module.ts
(see snippet below)
- Configures angular that to allow 3rd-party custom elements.
/*
* src/app/app.module.ts
*/
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule { }
-
TODO: Using
ref
to attach event listeners -
Warning: React's synthetic events violate non-bubbling specifications.
- It is a "known and intentional deviation".
- See facebook/react#12786 and facebook/react#6410 for information.
-
FYI: nesting a
<div>
within a<p>
seems to break data binding in VueJS 2.5- (codepen example)
- trying to track down the reason why this breaks
- To be continued...
- Custom Elements Everywhere
- Bypass synthetic event system for Web Component events (facebook/react#7901)