Skip to content

Add protected methods#1957

Merged
ai merged 2 commits intopostcss:mainfrom
nex3:protected-normalize
Aug 11, 2024
Merged

Add protected methods#1957
ai merged 2 commits intopostcss:mainfrom
nex3:protected-normalize

Conversation

@nex3
Copy link
Copy Markdown
Contributor

@nex3 nex3 commented Aug 8, 2024

These are useful when writing a package like the Sass parser that inherits from PostCSS types.

This allows subclasses to call and override this method. This PR also
adds a shared type declaration for the common argument type used to
add or create new nodes, which eventually gets passed into
`normalize`.
@nex3 nex3 changed the title Declare Container.normalize() as a protected method Add protected methods Aug 9, 2024
@nex3 nex3 force-pushed the protected-normalize branch from a0c8ad8 to fb6d62c Compare August 9, 2024 00:28
This is useful to call from subtypes.
@nex3 nex3 force-pushed the protected-normalize branch from fb6d62c to d6fa30b Compare August 9, 2024 05:39
@ai
Copy link
Copy Markdown
Member

ai commented Aug 11, 2024

Good additions

@ai ai merged commit a886628 into postcss:main Aug 11, 2024
@ai
Copy link
Copy Markdown
Member

ai commented Aug 11, 2024

Can you use version from github during your refactoring to make one release later?

@nex3 nex3 deleted the protected-normalize branch August 12, 2024 18:14
@nex3
Copy link
Copy Markdown
Contributor Author

nex3 commented Aug 12, 2024

Can you use version from github during your refactoring to make one release later?

I'm not sure I understand what you mean by this.

@ai
Copy link
Copy Markdown
Member

ai commented Aug 12, 2024

Do you need npm release?

@nex3
Copy link
Copy Markdown
Contributor Author

nex3 commented Aug 12, 2024

Oh, I see. No, the changes that aren't yet released are things we can work around for now.

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.

2 participants