Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ember-cli/ember-cli-htmlbars
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ember-cli/ember-cli-htmlbars
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.x
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 9 files changed
  • 4 contributors

Commits on Aug 11, 2020

  1. Pass isProduction to Ember template compiler.

    This flag allows the template compiler to have different behavior
    in production vs development builds.
    
    Co-authored-by: Robert Jackson <me@rwjblue.com>
    (cherry picked from commit 7da18b9)
    2 people authored and Robert Jackson committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    290db75 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #598 from ember-cli/backport-isProduction

    Pass `isProduction` to Ember template compiler.
    Robert Jackson
    Robert Jackson authored Aug 11, 2020
    Configuration menu
    Copy the full SHA
    e73a38d View commit details
    Browse the repository at this point in the history
  3. Release 4.4.0

    Robert Jackson
    Robert Jackson committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    4ec05dd View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2021

  1. Make cacheKey lazy

    Right now cacheKey is eagerly made during the included hook.
    This is problematic if you have configuration and addons working together.
    This defers making the cacheKey until it is requested during build.
    
    (cherry picked from commit b5fb8fa)
    krisselden authored and Robert Jackson committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    7a489a5 View commit details
    Browse the repository at this point in the history
  2. Add v4.4.1 to CHANGELOG.md.

    Robert Jackson
    Robert Jackson committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    1741f90 View commit details
    Browse the repository at this point in the history
  3. 4.4.1

    Robert Jackson
    Robert Jackson committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    3eb40a4 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2021

  1. Replace purgeModule cache busting with vm based sandboxing

    The template compiler contents have to be evaluated separately for each
    addon in the build pipeline. If they are **not** the AST plugins from
    one addon leak through to other addons (or the app).
    
    This issue led us to attempt to purge the normal node require cache (the
    `purgeModule` code). This works (and has been in use for quite a while)
    but causes a non-trivial amount of memory overhead since each of the addons'
    ends up with a separate template compiler. This prevents JIT'ing and it
    causes the source code of the template compiler itself to be in memory
    many many many times (non-trivially increasing memory pressure).
    
    Migrating to `vm.Script` and sandboxed contexts (similar to what is done
    in FastBoot) resolves both of those issues. The script itself is cached
    and not reevaluated each time (removing the memory pressure issues) and
    the JIT information of the script context is also shared.
    
    Thanks to @krisselden for pointing out this improvement!
    
    (cherry picked from commit 8d5dbcf)
    Robert Jackson
    Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    2798c0b View commit details
    Browse the repository at this point in the history
  2. Avoid building the template compiler cache key repeatedly

    (cherry picked from commit 47041c9)
    rwjblue authored and Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    64448c0 View commit details
    Browse the repository at this point in the history
  3. Remove usage of registerPlugin / unregisterPlugin

    These APIs force Ember to use global mutable state (the list of plugins)
    and require some pretty gnarly cache busting techniques to avoid having
    addons break each other (due to the global mutable state leaking from
    one addon to another).
    
    In order to discourage this mutable state issue, Ember has deprecated
    usage of `Ember.HTMLBars.registerPlugin` and
    `Ember.HTMLBars.unregisterPlugin` (as of Ember 3.27).
    
    This PR changes all invocations to pass the required AST transforms
    directly in to the compiler invocation (instead of calling
    `registerPlugin` before hand), and allows us to continue working
    properly while avoiding the deprecation (and that evil mutable state).
    
    (cherry picked from commit 1c813dc)
    rwjblue authored and Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    41afd22 View commit details
    Browse the repository at this point in the history
  4. Ensure Ember 3.27+ can determine global for template compilation.

    Node 12+ has access to `globalThis` (including within a VM context), but
    older versions do not.
    
    Due to the detection done in https://git.io/Jtb7s, when we can't find
    `globalThis` (and don't define `global` global) evaluating
    `ember-template-compiler.js` throws an error "unable to locate global
    object".
    
    This ensures that either `globalThis` or `global` are defined.
    
    (cherry picked from commit 957dbc6)
    rwjblue authored and Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    336d4d8 View commit details
    Browse the repository at this point in the history
  5. Ensure AST plugins have the same ordering as < ember-cli-htmlbars@5.5.0.

    We have to reverse these for reasons that are a bit bonkers. The initial
    version of this system used `registeredPlugin` from
    `ember-template-compiler.js` to set up these plugins (because Ember ~
    1.13 only had `registerPlugin`, and there was no way to pass plugins
    directly to the call to `compile`/`precompile`). Calling
    `registerPlugin` unfortunately **inverted** the order of plugins (it
    essentially did `PLUGINS = [plugin, ...PLUGINS]`).
    
    Sooooooo...... we are forced to maintain that **absolutely bonkers**
    ordering.
    
    (cherry picked from commit d8e5dda)
    rwjblue authored and Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    c1f98b1 View commit details
    Browse the repository at this point in the history
  6. Make setTimeout/clearTimeout available to the template compiler s…

    …andbox
    Robert Jackson
    Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    b97ad94 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    653e0d2 View commit details
    Browse the repository at this point in the history
  8. Add 4.5.0 to CHANGELOG.md.

    Robert Jackson
    Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    b781424 View commit details
    Browse the repository at this point in the history
  9. 4.5.0

    Robert Jackson
    Robert Jackson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    212cc38 View commit details
    Browse the repository at this point in the history
Loading