question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Remove Build Time Transforms

See original GitHub issue

It is currently possible to transform icons at build time from components into plain HTML using the option enableExperimentalBuildTimeTransform. This option was taken from the community addon and intended to accomplish two goals:

  1. Reduce file size of the application
  2. Remove unused icons from the build

Reduce application filesize In order to support dynamic options <FaIcon @icon="pencil" spin={{isSpinning}} /> we were never able to ship plain strings which the template compiler could de-duplicate. In FontAwesome v5 with it’s use of inline SVGs these transformed nodes are actually very large so application file size could be larger when build time transforms were enabled.

Remove unused icons It is not possible in the current ember build system to detect what icons are used in templates and include only those icons in the build. While the build time transform does allow some icons to be detected it still requires developers to include dynamic icons into the environment.js file and was never reliable across addon boundaries.

Conclusion As the enableExperimentalBuildTimeTransform adds significant complexity to this addon and may be impossible to port to the new ember embroiderer addon build and as the main goals of this option were never accomplished I propose removing it entirely before a v1.0.0 is released.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
arthur5005commented, Dec 19, 2019

@jrjohnson we couldn’t find any proper tools, so we decided to come up with a setup that illustrates the basic overhead of initial renders using the 3 types of components in Ember: Classic Ember, Glimmer Components and Template Only Glimmer Components.

Did some benchmarking by rendering 10,000 components; all we were looking for was the component rendering overhead.

We fed a uniq value to each component to render (1-10,000) to make sure we weren’t triggering some optimization.

On Ember 3.14 we compared:

  • Rendering 10,000 Ember Components
  • Rendering 10,000 Glimmer Components
  • Rendering 10,000 Template Only Glimmer Components
  • Rendering 10,000 <div>s with the value, instead of calling a component.

We had a button to render each set, then a reset button to measure teardown of the components, the following flame chart from the browser shows the results: Screen Shot 2019-12-19 at 9 53 13 AM

1reaction
jrjohnsoncommented, Feb 26, 2020

Nice @elgordino, one option I’ve been thinking about is only transforming completely static icons and an explicit component to signal that would possibly work very well.

This would combine very well with transforming <FaStaticIcon> into using a sprite instead of the fairly lengthy SVG string. This should speed up rendering significantly in places where many of the same icon are being used without blowing up the template size at the same time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[RFC] cleaning distDir on next build · Discussion #6009 - GitHub
One solution is cleaning distDir by default and providing an option to opt-out of this behavior. I'd like to get some feedback on...
Read more >
RFC 3264: An Offer/Answer Model with Session Description ...
Abstract This document defines a mechanism by which two entities can make use of the Session ... The SDP "t=" line conveys the...
Read more >
PROJ RFC 7: Drop Autotools, maintain CMake
This RFC proposes to drop Autotools for PROJ 9.0, and to maintain CMake for build automation, testing and packaging.
Read more >
[RFC] Deprecate and remove LLVM_BUILD_EXTERNAL ...
My inclination would be to remove it soon after LLVM 16 branches. That should give ample time for any migration. There are some...
Read more >
Request and Response Transforms
Most transforms provide TransformBuilderContext extension methods to make them easier to add ... This will remove the matching prefix from the request path....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found