lifeart / glimmer-next

GXT is `glimmer-vm` runtime alternative, only 7kb gzipped
https://g-next.netlify.app
MIT License
28 stars 3 forks source link

Ember.js compatibility #10

Open lifeart opened 5 months ago

lifeart commented 5 months ago

We could explore drop-in glimmer-vm replacement approach for glimmer-next. To achieve it, we need to build compatibility layer matching glimmer-vm API.

Here is a list of things to explore:

Here list of ~used glimmer parts in ember:

import { DEBUG } from '@glimmer/env';
import { isDestroyed, destroy, registerDestructor, associateDestroyableChild } from '@glimmer/destroyable';
import { getCustomTagFor, setInternalHelperManager, getInternalHelperManager, helperCapabilities, setHelperManager, capabilityFlagsFrom } from '@glimmer/manager';
import type { Tag, TagMeta } from '@glimmer/validator';
import { CONSTANT_TAG, consumeTag, dirtyTagFor, tagFor, untrack } from '@glimmer/validator';
import { CurriedType } from '@glimmer/vm';
import { programCompilationContext } from '@glimmer/opcode-compiler';
import { artifacts, RuntimeOpImpl } from '@glimmer/program';
import { createComputeRef, createConstRef, createPrimitiveRef, childRefFor, UNDEFINED_REFERENCE, valueForRef } from '@glimmer/reference';
import { EMPTY_ARRAY, unwrapTemplate } from '@glimmer/util';
import { reifyPositional } from '@glimmer/runtime';
lifeart commented 5 months ago

we need to create compat for

import { 
  createStorage, getValue, setValue 
} from '@glimmer/tracking/primitives/storage';
import {
  createStorage,
  getValue,
  setValue,
} from 'ember-tracked-storage-polyfill';

https://github.com/emberjs/rfcs/blob/2845588c167f2584ed3f24569d53d14abf8ab5ef/text/0669-tracked-storage-primitive.md

lifeart commented 4 months ago

we need to create compat for packages/@ember/-internals/metal/lib/tracked.ts

import { consumeTag, dirtyTagFor, tagFor, trackedData } from '@glimmer/validator';

https://github.com/lifeart/glimmer-next/pull/95

lifeart commented 4 months ago

TODO: glimmer reference

lifeart commented 4 months ago

TODO: poke with ember-source

lifeart commented 4 months ago

Here is POC with working ember-modifier, ember-helper, and glimmer components https://github.com/lifeart/glimmer-next/pull/25