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

Ensure _text is always available on JavaScript assets. #1182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexjeffburke
Copy link

As of assetgraph 7.1.0 assignment to the .text property keeps the
original source code available as _text. This is immensely useful
but has also opened up an unfortunate inconsistency because _text
is not populated from the rawSrc when such assets are instantiated.

In order to avoid adding special cases to callers try to make _text
uniformly available assetgraph is able to decode the raw buffer.

As of assetgraph 7.1.0 assignment to the .text property keeps the
original source code available as _text. This is immensely useful
but has also opened up an unfortunate inconsistency because _text
is not populated from the rawSrc when such assets are instantiated.

In order to avoid adding special cases to callers try to make _text
uniformly available assetgraph is able to decode the raw buffer.
@papandreou
Copy link
Member

I'd rather not have to do this extra work in the constructor, _text and _rawSrc are just supposed to be cached representations.

@papandreou
Copy link
Member

Can you take a step back and explain the use case?

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.

None yet

2 participants