Skip to content

2.0.0

Latest
Compare
Choose a tag to compare
@tomas-light tomas-light released this 08 Jul 21:49
3e85523
  • 🚀 add support for array string in search params;
const routes = createNiceWebRoutes({
  meeting: {
    new: {},
  },
});
routes.meeting.new.url({ memberIds: ['foo', 'bar', 'zoo'] }) // '/meeting/new?memberIds=foo&memberIds=bar&memberIds=zoo'
  • 🚀 add setBaseRoute method to change base route after routes are created;
const routes = createObjectNiceWebRoutes(
  {
    home: {},
    welcome: {},
  },
  { parentRoute: '/en' }
);

routes.home.url(); // "/en/home"
routes.welcome.url(); // "/en/welcome"

routes.setBaseRoute('/de');

routes.home.url(); // "/de/home"
routes.welcome.url(); // "/de/welcome"
  • 🚧🔨 changed factories signature, now parentRoute and currentSegmentName should be passed as options object;
// before
const routes = createNiceWebRoutes(
  {
    home: {},
    welcome: {},
  },
  '/en',
  '/some-segment'
);

// after
const routes = createNiceWebRoutes(
  {
    home: {},
    welcome: {},
  },
  {
    parentRoute: '/en',
    currentSegmentName: '/some-segment',
  }
);
  • 🔨 configure esm modules;
    Now here is cjs and esm directories with related module setup
    image