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

Solves Tagged template literal size optimization #7379

Merged
merged 2 commits into from Feb 20, 2018

Conversation

@debugpai
Copy link
Contributor

debugpai commented Feb 14, 2018

Q                       A
Fixed Issues? Fixes #7352
Tests Added + Pass? Yes
Any Dependency Changes? no
License MIT
  1. Adds a check to see if strings and raw strings are equal
  2. If they are equal doesn't pass raws to call expression
  3. Modifies taggedTemplateHelpers to slice strings if raws is not passed
solves #7352
@debugpai debugpai force-pushed the debugpai:tagged-template-literal branch from 4a316c3 to 349a2cf Feb 14, 2018
@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Feb 14, 2018

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/6887/

[
t.arrayExpression(strings),
!isStringsRawEqual ? t.arrayExpression(raws) : null,
].filter(x => x),

This comment has been minimized.

Copy link
@jridgewell

jridgewell Feb 14, 2018

Member

Let’s hoist out the array and push raws in inside an if-statement.

This comment has been minimized.

Copy link
@debugpai

debugpai Feb 14, 2018

Author Contributor

Made this change

@@ -0,0 +1 @@
var foo = tag`wow`;

This comment has been minimized.

Copy link
@jridgewell

jridgewell Feb 14, 2018

Member

Let’s add a multi quasi case:

var bar = tag`first${1}second`;

This comment has been minimized.

Copy link
@debugpai

debugpai Feb 14, 2018

Author Contributor

made this change

Copy link
Member

jridgewell left a comment

@loganfsmyth: would you like to review, too?

@jridgewell jridgewell requested a review from loganfsmyth Feb 14, 2018
@xtuc
xtuc approved these changes Feb 20, 2018
Copy link
Member

xtuc left a comment

Cool! Thanks for your pr

@jridgewell jridgewell merged commit dad05ed into babel:master Feb 20, 2018
4 checks passed
4 checks passed
babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 87.3% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
aminmarashi-binary added a commit to aminmarashi-binary/babel that referenced this pull request Mar 17, 2018
* Tagged template literal size optimization
solves babel#7352

* Incorporates review changes
@lock lock bot added the outdated label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.