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

Integrate Glimmer Macros For Binary VM #14781

Merged
merged 3 commits into from
Jan 17, 2017
Merged

Conversation

chadhietala
Copy link
Contributor

@chadhietala chadhietala commented Jan 4, 2017

This moves Ember over to the new Binary VM in glimmer (Requires this branch). Notable changes:

  • {{debugger}} is now implemented as a built-in Glimmer statement syntax due to the fact it needs access to the SymbolTable and other information from the VM. Also we now hard error if the debugger is passed an expression, from what I can tell this just failed silently is we did nothing with the positional or named params.
  • refineStatement on the Environment is no more in favor of populateMacros and block|inlines.addMissing.
  • No more syntax objects but now byte arrays. 😎

compile(builder) {
builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow);
}
export function inlineComponentMacro(path, params, hash, builder) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This likely can go away in favor of dynamicComponentMacro.

@homu
Copy link
Contributor

homu commented Jan 4, 2017

☔ The latest upstream changes (presumably #13549) made this pull request unmergeable. Please resolve the merge conflicts.

@chadhietala chadhietala changed the title Integrate Glimmer Macros For Stack-based VM Integrate Glimmer Macros For Binary VM Jan 4, 2017
annotation: 'strip sourceMappingURL'
});
}
// var glimmerEngine = require('glimmer-engine/ember-cli-build')({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably just delete it right?

This also changes the build to use the individual glimmer packages
@@ -64,7 +71,7 @@
"git-repo-info": "^1.1.4",
"git-repo-version": "^0.3.1",
"github": "^0.2.3",
"glimmer-engine": "^0.19.4",
"glimmer-engine": "^0.20.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need glimmer-engine?

@@ -27,6 +27,11 @@
"test:testem": "testem -f testem.dist.json"
},
"dependencies": {
"@glimmer/compiler": "^0.21.1",
"@glimmer/node": "^0.21.1",
"@glimmer/reference": "^0.21.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these all be the same version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't believe so. The way lerna publish works is that it looks if packages were effected in between the HEAD and the last tag if its not effected it will not publish a new version.

@@ -35,12 +40,14 @@
"ember-cli-test-info": "^1.0.0",
"ember-cli-valid-component-name": "^1.0.0",
"ember-cli-version-checker": "^1.1.7",
"handlebars": "~3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does ember have a handlebars dep? Seems like this should be in Glimmer and handled upon its publishing, or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krisselden might want to chime in here. I don't remember why we did this.

@@ -206,6 +205,11 @@ function createCurriedDefinition(definition, args) {
);
}

const EMPTY_BLOCKS = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be frozen?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least in dev mode, freezing it does make it a different "shape" polymorphic with the unfrozen versions, not sure if it is already polymorphic and empty and non empty should be both seen by the time it is JITed so may not matter.

let { symbolTable } = builder;

let definition;
if (name.indexOf('-') > -1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the contains dash caching here?

hash
} = BaselineSyntax.NestedBlock;

export function _inElementMacro(sexp, builder) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this moved into Ember itself? I thought it was baked into Glimmer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it was removed from Glimmer.


export function registerSyntax(key, syntax) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still like to export a mechanism to register macros. Without one we loose the ability to experiment with different syntaxes (e.g. ember-let).

It seems totally good to change it to a more generic thing like registerMacro, but we shouldn't remove the ability to customize/experiment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an API for this. Let me know what you think.

@rwjblue
Copy link
Member

rwjblue commented Jan 17, 2017

Awesome job here @chadhietala!

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.

4 participants