Skip to content

Support for nativescript 5 and 6 #60

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

Closed

Conversation

gustavost26
Copy link

Nativescript 5.4.0 is not accepting import with relative path, only accepts import with absolute path.

An error occurred while executing the command tns run ios --bundle --env.uglify --env.aot --env.report:

ERROR in node_modules / nativescript-grid-view / grid-view.d.ts (17,71): error TS2307: Can not find module 'ui / core / view'.
node_modules / nativescript-grid-view / grid-view.d.ts (18,64): error TS2307: Can not find module 'ui / list-view'.
node_modules / nativescript-grid-view / grid-view.d.ts (19,27): error TS2307: Can not find module 'data / observable'.
node_modules / nativescript-grid-view / angular / grid-view-comp.d.ts (20,14): error TS2416: Property 'nativeElement' in type 'GridViewComponent' is not assignable to the same property in base type 'TemplatedItemsComponent' .
  Property 'off' is missing in type 'GridView' but required in type 'TemplatedItemsView'.
(21,15): error TS2416: Property 'templatedItemsView' in type 'GridViewComponent' is not assignable to the same property in base type 'TemplatedItemsComponent' .
  Type 'GridView' is not assignable to type 'TemplatedItemsView'.

Fixed imports with absolute path so that the plugin is compatible with the new version of Nativescript 5 and 6.

…ccepts import with absolute path.

An error occurred while executing the command tns run ios --bundle --env.uglify --env.aot --env.report:

ERROR in node_modules / nativescript-grid-view / grid-view.d.ts (17,71): error TS2307: Can not find module 'ui / core / view'.
node_modules / nativescript-grid-view / grid-view.d.ts (18,64): error TS2307: Can not find module 'ui / list-view'.
node_modules / nativescript-grid-view / grid-view.d.ts (19,27): error TS2307: Can not find module 'data / observable'.
node_modules / nativescript-grid-view / angular / grid-view-comp.d.ts (20,14): error TS2416: Property 'nativeElement' in type 'GridViewComponent' is not assignable to the same property in base type 'TemplatedItemsComponent' .
  Property 'off' is missing in type 'GridView' but required in type 'TemplatedItemsView'.
(21,15): error TS2416: Property 'templatedItemsView' in type 'GridViewComponent' is not assignable to the same property in base type 'TemplatedItemsComponent' .
  Type 'GridView' is not assignable to type 'TemplatedItemsView'.

Fixed imports with absolute path so that the plugin is compatible with the new version of Nativescript 5 and 6.
@PeterStaev
Copy link
Owner

I'm well aware that the {N} core team is depreciating those short import paths and are pushing all devs to write the full. But this seems ridiculous as you have to type an additional 31 symbols for every import. You can read more details on the discussion/suggestions here: NativeScript/NativeScript#4041.

For all of my plugins I'm not going to fix the short imports until the core team implements a better solution for this. So I urge you to 👍 and comment on the above mentioned issue.

Short import paths continue to work w/o any problem if you use the correct paths in the tsconfig file:

"paths": {
"*": [
"./node_modules/tns-core-modules/*",
"./node_modules/*"
],
"~/*": [
"app/*"
]
}

@PeterStaev PeterStaev closed this Jul 20, 2019
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