Skip to content

Commit

Permalink
fix(compat form tag rendering): Fixes issue where form tags could not…
Browse files Browse the repository at this point in the history
… be rendered (#961)

* integration test for form tag
* fix(form-tag-rendering): Fixes issue where form tags could not be rendered
* remove define Property in uid
  • Loading branch information
davidturissini authored and Diego Ferreiro Val committed Jan 11, 2018
1 parent 3434992 commit c4d8484
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/lwc-engine/src/framework/modules/uid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { OwnerKey } from "../vm";
import { defineProperty } from './../language';


function updateUID(oldVnode: VNode, vnode: VNode) {
const { uid: oldUid } = oldVnode;
Expand Down
2 changes: 1 addition & 1 deletion packages/lwc-engine/src/framework/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function getAttrNameFromPropName(propName: string): string {
// otherwise we do the regular canonical transformation.
return propName.replace(CAPS_REGEX, (match: string): string => '-' + match.toLowerCase());
}

export const usesNativeSymbols = typeof Symbol() === 'symbol';
export function noop() {}

const classNameToClassMap = create(null);
Expand Down
4 changes: 2 additions & 2 deletions packages/lwc-engine/src/framework/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { getComponentDef } from "./def";
import { createComponent, linkComponent, renderComponent } from "./component";
import { patch } from "./patch";
import { ArrayPush, isUndefined, isNull, keys, defineProperties, ArrayUnshift, ArraySlice } from "./language";
import { addCallbackToNextTick, noop, EmptyObject } from "./utils";
import { addCallbackToNextTick, noop, EmptyObject, usesNativeSymbols } from "./utils";
import { ViewModelReflection } from "./def";
import { invokeServiceHook, Services } from "./services";
import { invokeComponentMethod } from "./invoker";
let idx: number = 0;
let uid: number = 0;

export const OwnerKey = Symbol('key');
export const OwnerKey = usesNativeSymbols ? Symbol('key') : '$$OwnerKey$$';

export function addInsertionIndex(vm: VM) {
if (process.env.NODE_ENV !== 'production') {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<form>
<div class="form-text">Form did render</div>
</form>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Element } from 'engine';

export default class TestFormTag extends Element {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const assert = require('assert');
describe('Object keys', () => {
const URL = 'http://localhost:4567/form-tag';
let element;

before(() => {
browser.url(URL);
});

it('should have the right value', function () {
const element = browser.element('.form-text');
assert.ok(element);
assert.deepEqual(element.getText(), 'Form did render');
});
});

0 comments on commit c4d8484

Please sign in to comment.