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

feat(webpack): mark the CSS type for stylable views explicitly #5257

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

PanayotCankov
Copy link
Contributor

@PanayotCankov PanayotCankov commented Jan 11, 2018

We want webpack's uglification to mangle function and class names
but that's what the current implementation of the CSS in {N} relies on
to get the CSS type for each view when targeted by CSS type selectors.

The implementation is changed a little so now the CSS type can be set
directly on the prototype of each View class or for TS, through decorator.

BREAKING CHANGES

Extending classes requires marking the derived class with @CSSType
The root classes are not marked with @CSSType and classes derived from ViewBase and View
will continue to work as expected. More concrete view classes (Button, Label, etc.) are
marked with @CSSType now and store their cssType on the prototype suppressing the previous
implementation that looked up the class function name. So client classes that derive from one of
our @CSSType decorated classes will now have to be marked explicitly with @CSSType.

@ghost ghost assigned PanayotCankov Jan 11, 2018
@ghost ghost added the in progress label Jan 11, 2018
@ghost ghost assigned sis0k0 Jan 26, 2018
sis0k0 added a commit to NativeScript/nativescript-dev-webpack that referenced this pull request Jan 26, 2018
Depends on:
NativeScript/android#923
NativeScript/NativeScript#5257

BREAKING CHANGES

`uglifyMangleExcludes` is no longer exported from the
nativescript-dev-webpack plugin and shouldn't be used in the webpack
configuration.

Before:
```
// webpack.config.js
// ...
uglifyOptions: {
    mangle: { reserved: nsWebpack.uglifyMangleExcludes },
    // ...
}

```

After:
```
// webpack.config.js
// ...
uglifyOptions: {
    // ...
}

```
@SvetoslavTsenov
Copy link
Contributor

test uitests sdk webpack

@sis0k0
Copy link
Contributor

sis0k0 commented Feb 28, 2018

test branch_android#plamen5kov/revert branch_webpack#vlaeva/remove-mangle-excludes testsappng

@sis0k0 sis0k0 changed the title feat(webpack): Mark the CSS type for stylable views explicitly feat(webpack): mark the CSS type for stylable views explicitly Mar 1, 2018
@sis0k0
Copy link
Contributor

sis0k0 commented Mar 1, 2018

test branch_android#plamen5kov/revert branch_webpack#vlaeva/remove-mangle-excludes testsappng sdk uitests cuteness qsf groceries

@sis0k0
Copy link
Contributor

sis0k0 commented Mar 7, 2018

test branch_android#plamen5kov/revert branch_webpack#vlaeva/remove-mangle-excludes testsappng sdk uitests cuteness qsf groceries animations

@SvetoslavTsenov
Copy link
Contributor

test branch_android#plamen5kov/revert branch_webpack#vlaeva/remove-mangle-excludes branch__testsappng#master branch_sdk#master branch_cuteness#master branch_qsf#master branch_groceries#master branch_animations#master

@SvetoslavTsenov
Copy link
Contributor

test branch_android#plamen5kov/revert branch_webpack#vlaeva/remove-mangle-excludes branch_testsappng#master branch_sdk#master branch_cuteness#master branch_qsf#master branch_groceries#master branch_animations#master

@SvetoslavTsenov
Copy link
Contributor

test branch_webpack#vlaeva/remove-mangle-excludes branch_testsappng#master branch_sdk#master branch_cuteness#master branch_qsf#master branch_groceries#master branch_animations#master

@SvetoslavTsenov
Copy link
Contributor

This one should be rebased since we cannot build modules

We want webpack's uglification to mangle function and class names
but that's what the current implementation of the CSS in {N} relys on
to get the CSS type for each view when targeted by CSS type selectors.

The implementation is changed a little so now the CSS type can be set
directly on the prototype of each View class or for TS, through decorator.

BREAKING CHANGE: Extending classes requires marking the derived class with @csstype
The root classes are not marked with CSSType and classes derived from ViewBase and View
will continue to work as expected. More concrete view classes (Button, Label, etc.) are
marked with @csstype now and store their cssType on the prototype suppressing the previous
implementation that looked up the class function name. So clien classes that derive from one of
our @csstype decorated classes will now have to be marked with @csstype.
@sis0k0
Copy link
Contributor

sis0k0 commented Mar 12, 2018

@SvetoslavTsenov, rebased

@sis0k0
Copy link
Contributor

sis0k0 commented Mar 12, 2018

test branch_webpack#vlaeva/remove-mangle-excludes branch_testsappng#master branch_sdk#master branch_cuteness#master branch_qsf#master branch_groceries#master branch_animations#master

@SvetoslavTsenov
Copy link
Contributor

👍

@sis0k0 sis0k0 merged commit 1cbb1e8 into master Mar 12, 2018
@ghost ghost removed the in progress label Mar 12, 2018
@sis0k0 sis0k0 deleted the css-type-decorator branch March 12, 2018 14:34
sis0k0 added a commit to NativeScript/nativescript-dev-webpack that referenced this pull request Mar 12, 2018
Depends on:
NativeScript/android#923
NativeScript/NativeScript#5257

BREAKING CHANGES

`uglifyMangleExcludes` is no longer exported from the
nativescript-dev-webpack plugin and shouldn't be used in the webpack
configuration.

Before:
```
// webpack.config.js
// ...
uglifyOptions: {
    mangle: { reserved: nsWebpack.uglifyMangleExcludes },
    // ...
}

```

After:
```
// webpack.config.js
// ...
uglifyOptions: {
    // ...
}

```
sis0k0 added a commit to NativeScript/nativescript-dev-webpack that referenced this pull request Mar 12, 2018
Depends on:
NativeScript/android#923
NativeScript/NativeScript#5257

BREAKING CHANGES:

`uglifyMangleExcludes` is no longer exported from the
nativescript-dev-webpack plugin and shouldn't be used in the webpack
configuration.

Before:
```
// webpack.config.js
// ...
uglifyOptions: {
    mangle: { reserved: nsWebpack.uglifyMangleExcludes },
    // ...
}

```

After:
```
// webpack.config.js
// ...
uglifyOptions: {
    // ...
}

```
sis0k0 added a commit to NativeScript/nativescript-dev-webpack that referenced this pull request Mar 12, 2018
Depends on:
NativeScript/android#923
NativeScript/NativeScript#5257

BREAKING CHANGES:

`uglifyMangleExcludes` is no longer exported from the
nativescript-dev-webpack plugin and shouldn't be used in the webpack
configuration.

Before:
```
// webpack.config.js
// ...
uglifyOptions: {
    mangle: { reserved: nsWebpack.uglifyMangleExcludes },
    // ...
}

```

After:
```
// webpack.config.js
// ...
uglifyOptions: {
    // ...
}

```
@lock
Copy link

lock bot commented Aug 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants