Skip to content

[Tracking] Scoped Packages #7895

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

Open
29 of 42 tasks
vakrilov opened this issue Oct 2, 2019 · 0 comments
Open
29 of 42 tasks

[Tracking] Scoped Packages #7895

vakrilov opened this issue Oct 2, 2019 · 0 comments

Comments

@vakrilov
Copy link
Contributor

vakrilov commented Oct 2, 2019

Original issue/idea discussed in #4041
Link to design document

  • @nativescript/core package

    • Move all the code to @nativescript/core generate the tns-core-modules compatibility package

    • generate tests that validate that compatibility package exports all modules

    • Update developer workflow. There should be an easy way to setup the nativescript/nativescript repo so that you can run the tests and all e2e projects with linked modules and HMR.

    • Do a detailed review of the barrel exports:

      • @nativescript/core
      • @nativescript/core/ui
      • @nativescript/core/ui/layouts
      • Missing modules. Style, FormattedString etc.
        • Styling -> there are a couple of useful things from styling modules:
        • export { addTaggedAdditionalCSS, removeTaggedAdditionalCSS } from "./styling/style-scope";
        • export { Style } from "./styling/style";
        • FormattedString, Text, Span
    • Move methods exported by modules into static class-mehtods, thus eliminating the need of ns prefix-ed objects. Problematic modules:

      • Frame
      • Builder
      • ImageSource
      • Application
      • Application-settings
      • Connectivity
      • Http
      • Profiling
      • Trace
      • Utils
      • consider using namespaces where appropriate
    • Move modules into ui. Create re-exports on the original place for back-compat. Models that should be moved in ui:

      • FormattedString and Span
    • Handle EventDatas and clashing interfaces names. Try to define all event-data interfaces in one place only and reuse.

    • generate documentation (with typedoc) for the scoped packages.

      • Research if we can generate typedoc for barrel files (seems now that re-exported modules are not documented). Result: rollup d.ts generated with api-extractor.
      • Docs for functions re-exported inside objects (ex. Trace, Utils) are not visible in the docs.
    • Run the e2e/scoped-packages application on CI

  • @nativescript/angular package

    • Move all the code to @nativescript/angular and create nativescript-angular compatibility package (either generate it or manually create it)
    • Update developer workflow. There should be an easy way to setup the nativescript-angular repo so that you can run the tests and all e2e projects with linked modules and HMR.
  • nativescript-dev-webpack package

    • Remove the tns-core-module/xml dependency in the xml-namespace-loader
    • Make sure webpack works with the tns-core-modules compatibility package without the need to change configuration.
    • Make sure all generated code from webpack loaders uses the scoped packages. This way people won't have to still include the compat packages in their projects. Add a check that scoped-packages exist in the project and show "not compatible" error otherwise.
  • nativescript-cli

    • ...
  • Create an ESLint rule for migrating to scoped packages imports  #8131 Migration tool (eslint rule with auto-fix). It should:

    • convert all tns-core-modules imports to @nativescript/core imports
    • convert all nativescript-angular imports to @nativescript/angular imports
@vakrilov vakrilov mentioned this issue Oct 7, 2019
5 tasks
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

No branches or pull requests

1 participant