React.NET icon indicating copy to clipboard operation
React.NET copied to clipboard

Serving multiple versions of components package

Open dnovacik opened this issue 3 years ago • 2 comments

Hi, is there a support to serve multiple version of an npm component package?

E.g.: I have a components library of v1.0 but there will be major changes in v2.0 that would break the earlier pages made with v1.0, is there an ability to provide multiple versions of that package and serve by some version property?

the scripts are added in the startup:

app.UseReact(config =>
{
  config
    .SetReuseJavaScriptEngines(true)
    .SetLoadBabel(false)
    .SetLoadReact(false)
    .SetReactAppBuildPath("~/dist");
});

is there a way to provide it with different versions?

(inserting proper version into _Layout.cshtml doesn't seem like a problem, neither installing different version with npm alias and/or outputting to dist folders with version)

Thanks

dnovacik avatar Nov 02 '21 10:11 dnovacik

I think webpack has support for this via aliases. Your entry point would be something like

module.exports = { ComponentV1 = require(‘componentv1’), ComponentV2 = require(‘componentv2’) }

I don’t remember offhand what webpack config changes are needed to make it work.

On Tue, Nov 2, 2021 at 06:25, Daniel Nováčik @.***> wrote:

Hi, is there a support to serve multiple version of an npm component package?

E.g.: I have a components library of v1.0 but there will be major changes in v2.0 that would break the earlier pages made with v1.0, is there an ability to provide multiple versions of that package and serve by some version property?

the scripts are added in the startup:

app.UseReact(config => { config .SetReuseJavaScriptEngines(true) .SetLoadBabel(false) .SetLoadReact(false) .SetReactAppBuildPath("~/dist"); });

is there a way to provide it with different versions?

(inserting proper version into _Layout.cshtml doesn't seem like a problem, neither installing different version with npm alias and/or outputting to dist folders with version)

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/reactjs/React.NET/issues/1272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHGCFUF43UOHV6RCTVNMETUJ64CZANCNFSM5HGC3CMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

dustinsoftware avatar Nov 02 '21 10:11 dustinsoftware

Oh so I would have several entry points and outputs with versions and use the app.UseReact with just the ~dist folder with all the versions and just include them in the layout. so it would be only about setting the webpack right?

Thanks I'll try to set it up

dnovacik avatar Nov 02 '21 11:11 dnovacik