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 #66

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Widen @glimmer/syntax range #66

merged 1 commit into from
Dec 17, 2024

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Dec 5, 2024

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 be using @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 terminals 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;
}

// ...

// For Mustache and Path
transform(node) {
  
  const functionName = getValue(node.path);

  // ...
  // @glimmer/syntax > 0.84.3
  if ('value' in node.path) {
	  node.path.value = 't';
	  node.params = [node.params[0]];
	  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;
  }

@ef4 ef4 added the bug Something isn't working label Dec 17, 2024
@ef4 ef4 merged commit d72607e into main Dec 17, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants