emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

Document and provide imports for Ember.HTMLBars.* #16321

Closed Gaurav0 closed 6 years ago

Gaurav0 commented 6 years ago

The following apis:

Ember.HTMLBars.precompile Ember.HTMLBars.compile

have not been documented in ember-api-docs since they were removed from the ember core build in Ember 1.13 as part of the update to Glimmer 1. AFAIK, they are still public. They also do not have RFC-176 imports.

precompile is used by ember-cli and by ember-cli-htmlbars-inline-precompile to precompile templates to wire format. It is also required by addons that render server side such as ember-fastboot.

compile is required by applications such as Ember-Twiddle that need to compile templates client side.

rwjblue commented 6 years ago

Reviewed this with @tomdale the other day (while triaging the list in https://github.com/ember-cli/ember-rfc176-data/issues/12), we came up with the following:

Ember.HTMLBars.template -> import { wrapTemplate } from '@ember/template-compilation';
Ember.HTMLBars.compile -> import { compileTemplate } from '@ember/template-compilation';
Ember.HTMLBars.precompile -> import { precompileTemplate } from '@ember/template-compilation';
rwjblue commented 6 years ago

https://github.com/ember-cli/ember-rfc176-data/pull/48 adds the implementation needed, now we need to update docs to reflect the new paths.

locks commented 6 years ago

cc @emberjs/learning-team-managers

krisselden commented 6 years ago

@rwjblue This one is not correct Ember.HTMLBars.template -> import { wrapTemplate } from '@ember/template-compilation'; as this is not used in compilation it is an import that is in the string of the compiled template used at runtime. It does not belong in template-compilation.

template comes from ember-glimmer because it is a runtime thing, it is the factory for a template singleton in the DI, and compile and precompile come from the ember-template-compiler

rwjblue commented 6 years ago

Indeed I am aware of where they come from! 😆

Please feel free to provide a suggestion (without one we will likely just push forward here).

krisselden commented 6 years ago

Ember.HTMLBars.template -> import template from '@ember/template'

yininge commented 6 years ago

I think we can close this one. It looks like the documentation is added to https://github.com/ember-cli/ember-rfc176-data

pixelhandler commented 6 years ago

screen shot 2018-09-21 at 2 38 17 pm

Thanks @yininge I see the imports listed at https://github.com/ember-cli/ember-rfc176-data

@Gaurav0 I'll close this for now, I think the repo above does provide the documentation. cc @emberjs/learning-team-managers