deprecate / metal-uri

Class for parsing and formatting URIs.
Other
3 stars 7 forks source link

Problems consuming metal-uri@3.0.0 #23

Closed jbalsas closed 6 years ago

jbalsas commented 6 years ago

Moving our parse logic to url-parse has the side-effect of a less-than-ideal necessary build step or setup.

Someone consuming it needs to be aware of how to build it. There might be several scenarios:

Webpack / Rollup / Browserify build

This is expected to work as the bundling tools already know how to deal with the different dependencies

Karma config setup

Currently, a very barebone setup for testing modules consuming metal-* dependencies looked like this:

  frameworks: ['mocha', 'chai', 'sinon', 'source-map-support', 'commonjs'],

  files: [
    'node_modules/metal/src/**/*.js',
    'node_modules/metal-*/src/**/*.js',
    'src/**/!(node)/*.js',
    'test/environment/browser/env.js',
    'test/**/*.js',
  ],

  exclude: ['src/env/node.js', 'test/**/node/**/*.js'],

  preprocessors: {
    'src/**/*.js': ['babel', 'commonjs'],
    'node_modules/metal/**/*.js': ['babel', 'commonjs'],
    'node_modules/metal-*/**/*.js': ['babel', 'commonjs'],
    'test/**/*.js': ['babel', 'commonjs'],
  },

  babelPreprocessor: {options: babelOptions},

A project depending on metal-uri would now likely need to add browserify and serve additional files such as node_modules/url-parse (and transitive dependencies) or serve and preprocess everything inside node_modules just to be sure.

While I guess we would all agree this is not the ideal scenario, what options do we have? Should we:

@eduardolundgren, @ipeychev, @Robert-Frampton, thoughts?

ipeychev commented 6 years ago

I would say to ship a version which works in the browser (the developer will add it to Karma files) in addition to the node version would be the golden middle.

robframpton commented 6 years ago

I agree that it's annoying, but since we already face this same problem with metal in general I don't see it as a huge deal.

We're already in the place where the only real way to use metal core is with some kind of bundler.

robframpton commented 6 years ago

Closing this since we figured out the issues on the https://github.com/wedeploy/wedeploy-sdk-js.