nstudio / nativescript-checkbox

NativeScript plugin for checkbox UI component
Other
119 stars 56 forks source link

ngcc.config.js file still needed? #137

Closed relez closed 3 years ago

relez commented 3 years ago

Hi there, I just updated to version 2.0.2 and the plugin still needs the ngcc file to ivy compatibility. Are you guys planning to update it to ivy compatibility without the need of ngcc.config.js file?

Thanks!

bradmartin commented 3 years ago

Would love to drop this if it's indeed no longer needed for ivy compat. I'm not sure how to actually handle this currently. So if you have time for a PR that would be great.

relez commented 3 years ago

Hey @bradmartin thanks for quick respond, its currently working fine with ngcc file which is fine for me for now. Its just that is the only plugin that needs the ngcc file in my projects, thats why I asked. Take your time fixing it, no rush.

Thanks!

Mister-N commented 3 years ago

Could you please show your ngcc.config.js? I'm trying this file https://github.com/nstudio/nativescript-checkbox/blob/master/demo-ng/ngcc.config.js


ERROR in ../node_modules/@nstudio/nativescript-checkbox/__ivy_ngcc__/angular/index.js
Module not found: Error: Can't resolve '../checkbox' in '<..>/angular-test/node_modules/@nstudio/nativescript-checkbox/__ivy_ngcc__/angular'
 @ ../node_modules/@nstudio/nativescript-checkbox/__ivy_ngcc__/angular/index.js 21:49-71
 @ ./app/home/home.module.ts
 @ ./app/app.module.ts
 @ ./main.tns.ts

"@nativescript/core": "~7.0.0" with angular 10.

relez commented 3 years ago

My ngcc.config.js has this:

module.exports = {
    packages: {
        '@nstudio/nativescript-checkbox': {
            entryPoints: {
                angular: {
                    override: {
                    main: './index.js',
                    typings: './index.d.ts',
                    },
                ignoreMissingDependencies: true,
                },
            },
            ignorableDeepImportMatchers: [
                /tns-core-modules\//,
                /@nativescript\/core\//,
                /@nativescript\/angular\//
            ],
        },
    }
}

My package.json dependencies looks like this:

"dependencies": {
    "@angular/animations": "~10.1.0",
    "@angular/common": "~10.1.0",
    "@angular/compiler": "~10.1.0",
    "@angular/core": "~10.1.0",
    "@angular/forms": "~10.1.0",
    "@angular/platform-browser": "~10.1.0",
    "@angular/platform-browser-dynamic": "~10.1.0",
    "@angular/router": "~10.1.0",
    "@nativescript-community/drawingpad": "~4.0.0",
    "@nativescript/angular": "~10.0.0",
    "@nativescript/appversion": "~2.0.0",
    "@nativescript/background-http": "~5.0.0",
    "@nativescript/camera": "~5.0.2",
    "@nativescript/core": "7.0.8",
    "@nativescript/datetimepicker": "^2.0.3",
    "@nativescript/directions": "~2.0.0",
    "@nativescript/email": "~2.0.0",
    "@nativescript/geolocation": "~7.0.0",
    "@nativescript/imagepicker": "~1.0.0",
    "@nativescript/iqkeyboardmanager": "~2.0.0",
    "@nativescript/webpack": "~3.0.5",
    "@nstudio/nativescript-checkbox": "~2.0.2",
    "@nstudio/nativescript-loading-indicator": "~4.0.0",
    "@proplugins/nativescript-dom": "~2.2.3",
    "@proplugins/nativescript-drop-down": "~9.0.0",
    "@proplugins/nativescript-globalevents": "~1.4.4",
    "@proplugins/nativescript-orientation": "~2.5.0",
    "@proplugins/nativescript-photo-editor": "~5.0.0",
    "moment": "~2.24.0",
    "nativescript-barcodescanner": "~4.0.1",
    "nativescript-feedback": "~2.0.0",
    "nativescript-inappbrowser": "~2.3.0",
    "nativescript-mediafilepicker": "~3.0.1",
    "nativescript-numeric-keyboard": "~5.0.0",
    "nativescript-pdf-view": "~2.4.3",
    "nativescript-phone": "~2.0.0",
    "nativescript-theme-core": "~1.0.6",
    "nativescript-ui-calendar": "~7.0.2",
    "nativescript-ui-chart": "~8.0.2",
    "nativescript-ui-listview": "~9.0.2",
    "nativescript-ui-sidedrawer": "~9.0.3",
    "nativescript-videoplayer": "~5.0.1",
    "nativescript-videorecorder": "~3.0.0-beta.6",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.6.0",
    "zone.js": "~0.11.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~10.1.0",
    "@nativescript/android": "7.0.0",
    "@nativescript/ios": "7.0.0",
    "@ngtools/webpack": "~10.1.0",
    "codelyzer": "~6.0.0",
    "copy-webpack-plugin": "6.0.3",
    "terser-webpack-plugin": "2.2.0",
    "typescript": "~3.9.5",
    "webpack": "4.43.0",
    "webpack-cli": "^3.3.12"
  },

I hope this helps.

tizian-bitschi commented 3 years ago

Any updates here? I am using the same ngcc.config.js but still getting the error as mentioned before.

tizian-bitschi commented 3 years ago

@Mister-N I got it! Take a look at node_modules/@nstudio/nativescript-checkbox/__ivy_ngcc__/angular/index.js. Edit Line 21 to the following: registerElement('CheckBox', function () { return require('../../checkbox').CheckBox; }); (add ../ to require) This is not a great solution but it works for now until its fixed.

NathanWalker commented 3 years ago

This is fixed in 2.0.3 now 👍