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

Deprecate w-preserve-attrs #422

Closed
patrick-steele-idem opened this issue Nov 11, 2016 · 5 comments
Closed

Deprecate w-preserve-attrs #422

patrick-steele-idem opened this issue Nov 11, 2016 · 5 comments
Assignees
Labels
type:feature A feature request
Milestone

Comments

@patrick-steele-idem
Copy link
Contributor

patrick-steele-idem commented Nov 11, 2016

w-preserve-attrs<input style:no-update=”” title:no-update>

Old:

<div style="color:#09c" w-preserve-attrs="style">
    ...
</div>

New:

<div style:no-update="color:#09c">
    ...
</div>
@austinkelleher
Copy link
Member

I can take this one.

/cc @mlrawlings

@austinkelleher
Copy link
Member

austinkelleher commented Nov 16, 2016

This would be an unlikely case, but do you think we should consolidate w-preserve-attrs and :no-update if both are present? We will of course log a deprecation warning when w-preserve-attrs is used regardless.

<div style:no-update="color:#09c" class="test" w-preserve-attrs="class">
...
</div>
<!-- Doesn't matter that it's listed under `class:no-update` and `w-preserve-attrs`. -->
<div style:no-update="color:#09c" class:no-update="test" w-preserve-attrs="class">
...
</div>

/cc @mlrawlings What do you think?

@austinkelleher
Copy link
Member

I'm personally leaning toward consolidating because they will function the same anyway.

@mlrawlings
Copy link
Member

mlrawlings commented Nov 16, 2016

@austinkelleher I think consolidation makes the most sense as well. Ideally, this would be done in such a way that the code for w-preserve-attrs can easily be removed in the future.

My thinking is both

<div style:no-update="color:#09c" class="test" w-preserve-attrs="class">
...
</div>

and

<!-- Doesn't matter that it's listed under `class:no-update` and `w-preserve-attrs`. -->
<div style:no-update="color:#09c" class:no-update="test" w-preserve-attrs="class">
...
</div>

Would be transformed to:

<div style:no-update="color:#09c" class:no-update="test">
...
</div>

And then the code for no-update would take over.

@mlrawlings
Copy link
Member

FYI, I've added a new method to do deprecations from the compiler that tracks the node and line:column in the original template code.

context.deprecate('deprecation warning text');

austinkelleher added a commit to austinkelleher/marko that referenced this issue Jan 1, 2017
patrick-steele-idem added a commit that referenced this issue Jan 3, 2017
…attrs

Fixes #422 - Introduce :no-update attribute and deprecate w-preserve-…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature A feature request
Projects
None yet
Development

No branches or pull requests

3 participants