Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(components): remove faulty whitespace #606

Merged
merged 3 commits into from
Jan 17, 2019
Merged

fix(components): remove faulty whitespace #606

merged 3 commits into from
Jan 17, 2019

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jan 17, 2019

If an inline element has whitespace, and then a text node, Vue will preserve this whitespace inside the component, and thus it will take up bundle size (a tiny little bit)

If an inline element has whitespace, and then a text node, Vue will preserve this whitespace inside the component, and thus it will take up bundle size (a tiny little bit)
@Haroenv Haroenv requested a review from a team January 17, 2019 09:05
src/mixins/widget.js Outdated Show resolved Hide resolved
Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

In InstantSearch.js, we compress the templates to avoid creating unnecessary text nodes (algolia/instantsearch#3176). This allows to keep our templates more readable.

In React, we don't have this issue because JSX ignores whitespaces. Is there any way to achieve that with Vue?

src/mixins/widget.js Show resolved Hide resolved
@Haroenv
Copy link
Contributor Author

Haroenv commented Jan 17, 2019

I've looked and no automatic way exists to do these changes

@francoischalifour
Copy link
Member

I came across this thread but it might be too complex for now.

@Haroenv Haroenv merged commit c7541b1 into v2 Jan 17, 2019
@Haroenv Haroenv deleted the chore/whitespace branch January 17, 2019 11:40
@samouss
Copy link
Contributor

samouss commented Jan 17, 2019

I would have prefer to use the whitespace option when it's available rather than Vue template that became a bit harder to read.

@Haroenv
Copy link
Contributor Author

Haroenv commented Jan 17, 2019

We are not using the vue-template-compiler here, but good call, I'll witch to that at some later point 😎 @samouss

@samouss
Copy link
Contributor

samouss commented Jan 17, 2019

We do through the Rollup plugin.

Haroenv added a commit that referenced this pull request Jan 18, 2019
* fix(components): remove faulty whitespace

If an inline element has whitespace, and then a text node, Vue will preserve this whitespace inside the component, and thus it will take up bundle size (a tiny little bit)

* chore(error): no newline

* chore(error): https
@Haroenv Haroenv mentioned this pull request Jan 23, 2019
Closed
Haroenv added a commit to algolia/instantsearch that referenced this pull request Dec 28, 2022
)

* fix(components): remove faulty whitespace

If an inline element has whitespace, and then a text node, Vue will preserve this whitespace inside the component, and thus it will take up bundle size (a tiny little bit)

* chore(error): no newline

* chore(error): https
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants