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

Add bemhtml-es2015 tech #274

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add bemhtml-es2015 tech #274

wants to merge 2 commits into from

Conversation

rakchaev
Copy link

@rakchaev rakchaev commented May 8, 2017

No description provided.

Copy link
Member

@miripiruni miripiruni left a comment

Choose a reason for hiding this comment

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

Why we need such techs (es2015, es2016, etc) in enb-bemxjst?

@@ -0,0 +1,42 @@
var path = require('path');
Copy link
Member

Choose a reason for hiding this comment

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

Unused variable.

@rakchaev
Copy link
Author

In techs such enb-es2015 (https://github.com/DimitryDushkin/enb-es2015) we can transpile just source files (form blocks) before gathering to a single file.
It's faster then transpile a big file.

If we need to transpile bemhtml code for browser, we should use babel+bemhtml processing before gathering to a single file.
It seems this is appropriate place: https://github.com/enb/enb-bemxjst/blob/master/techs/bemhtml.js#L67-L68

@qfox
Copy link
Contributor

qfox commented May 10, 2017

@miripiruni Because of ENB-mechanics. It doesn't allow to process source files before putting them to processing technologies.

@tadatuta
Copy link
Member

@rakchaev it should be possible to compile BEMHTML bundle with default tech, transpile it to ES5 with universal transpiler tech and then merge with client bundle.

@qfox
Copy link
Contributor

qfox commented May 10, 2017

it should be possible to compile BEMHTML bundle with default tech

But he said:

It's (transpiling few small files) faster than transpile a big file.

@tadatuta
Copy link
Member

I've got two questions:

  1. Why not to transpile just in production mode when build time is not so important?
  2. Is client template bundle really so huge that build time difference become important?

@rakchaev
Copy link
Author

@tadatuta

  1. It's possible. But if your browser doesn't support for some ES feature or you need to debug site in not modern browser, code won't work.
  2. It depends on project. It can be big. But difference between transpiling of n chunks of m size and 1 chunk of n*m size is really significant. Likely, it's because of parsing to AST or manipulation of AST logic.

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