FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(webpack): mark the CSS type for stylable views explicitly by PanayotCankov · Pull Request #5257 · NativeScript/NativeScript · GitHub

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

Merged
sis0k0 merged 1 commit into
masterfrom
css-type-decorator
Mar 12, 2018
Merged

sis0k0 merged 1 commit into
masterfrom
css-type-decorator

Conversation

PanayotCankov commented Jan 11, 2018 •
edited by sis0k0
Loading

Copy link
Copy Markdown
Contributor

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 assigned PanayotCankov Jan 11, 2018
ghost added the in progress label Jan 11, 2018
sis0k0 force-pushed the css-type-decorator branch from a30708c to 95f609a Compare January 26, 2018 16:58
ghost assigned sis0k0 Jan 26, 2018
sis0k0 force-pushed the css-type-decorator branch from 95f609a to 3bc17b5 Compare January 26, 2018 17:05
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: {
    // ...
}

```

Copy link
Copy Markdown
Contributor

test uitests sdk webpack

sis0k0 commented Feb 28, 2018

Copy link
Copy Markdown
Contributor

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

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 commented Mar 1, 2018

Copy link
Copy Markdown
Contributor

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

sis0k0 commented Mar 7, 2018

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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 force-pushed the css-type-decorator branch from 3bc17b5 to 93ab567 Compare March 12, 2018 08:19

sis0k0 commented Mar 12, 2018

Copy link
Copy Markdown
Contributor

@SvetoslavTsenov, rebased

sis0k0 commented Mar 12, 2018

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Contributor

👍

sis0k0 merged commit 1cbb1e8 into master Mar 12, 2018
ghost removed the in progress label Mar 12, 2018
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 Bot commented Aug 26, 2019

Copy link
Copy Markdown

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 Bot locked and limited conversation to collaborators Aug 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL