Skip to content
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

Widen glimmer syntax range #998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kiwiupover
Copy link

pnpm treats ^ on pre-1.0 versions as patch-range-only updates.

When using ember-source 5.9+, if you have addons that transform HBS, they will likely use @glimmer/syntax 0.84.3. But with the visitor-invoker in ember-source's template-compiler, TOOOONS of deprecations get logged -- this usually blows past your terminal's scroll buffer, as well as GitHub's web-logging (you have to download logs). @glimmer/syntax throughout the dependency graph should be at least 0.92.3. or all transforms need to support both 0.84.3 and 0.92... which usually involves some form of:

/**
 * node.path.original is DEPRECATED in newer versions of @glimmer/syntax
 * '.value' is the new property to use, but it does not exist in older versions
 * of @glimmer/syntax
 */
function getValue(node) {
	if (!node) {
		return;
	}

	const name = 'value' in node ? node.value : node.original;

	return name;
}

	const functionName = getValue(node.path);

    // ...
    // @glimmer/syntax > 0.84.3
    if ('value' in node.path) {
	    node.path.value = 't';
	    node.path.parts = ['t', ...node.path.parts.slice(1)];
	    node.params = [node.params[0]];
	    node.params[0].value = node.params[0].value = id;
    } else {
	    // @glimmer/syntax 0.84.3 and earlier
	    node.path.original = 't';
	    node.path.parts[0] = 't';
	    node.params = [node.params[0]];
	    node.params[0].value = node.params[0].original = id;
    }

pnpm treats ^ on pre-1.0 versions as patch-range-only updates.

When using ember-source 5.9+, if you have addons that transform HBS, they will likely use @glimmer/syntax 0.84.3. But with the visitor-invoker in ember-source's template-compiler, TOOOONS of deprecations get logged -- this usually blows past your terminal's scroll buffer, as well as GitHub's web-logging (you have to download logs). @glimmer/syntax throughout the dependency graph should be at least 0.92.3. or all transforms need to support both 0.84.3 and 0.92... which usually involves some form of:

```js
/**
 * node.path.original is DEPRECATED in newer versions of @glimmer/syntax
 * '.value' is the new property to use, but it does not exist in older versions
 * of @glimmer/syntax
 */
function getValue(node) {
	if (!node) {
		return;
	}

	const name = 'value' in node ? node.value : node.original;

	return name;
}

	const functionName = getValue(node.path);

    // ...
    // @glimmer/syntax > 0.84.3
    if ('value' in node.path) {
	    node.path.value = 't';
	    node.path.parts = ['t', ...node.path.parts.slice(1)];
	    node.params = [node.params[0]];
	    node.params[0].value = node.params[0].value = id;
    } else {
	    // @glimmer/syntax 0.84.3 and earlier
	    node.path.original = 't';
	    node.path.parts[0] = 't';
	    node.params = [node.params[0]];
	    node.params[0].value = node.params[0].original = id;
    }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant