dotcom-page-kit icon indicating copy to clipboard operation
dotcom-page-kit copied to clipboard

Installing Origami components using npm

Open i-like-robots opened this issue 5 years ago • 6 comments

@chee and I have been talking about how the Origami team now publish their components onto npm as well as Bower. Several members of the customer products team are very keen to ditch Bower and migrate wholly to using npm--which makes some sense--however our conclusion so far is:

Don't even think about it!

The reason for this is that there is a long tail of tricky things which need to be resolved first but they're of lower priority than migrating apps to using the tooling provided by ~Anvil~ Page Kit.

i-like-robots avatar Mar 04 '19 11:03 i-like-robots

From @chee on Slack:

Further on this, I think because of many of the dependencies of n-ui are problematic, moving to Anvil is a prerequisite for moving to npm.

It will require some co-ordinated work to get apps & anvil to switch to npm from bower later, but that is not a problem to solve now.

The best we can do now is keeping on with the philosophy Anvil already has of modularity, so that the scope is as small as possible when it comes to solving that separate problem later.

But basically, yeah don’t think about it yet. It’s a job on its own.

i-like-robots avatar Mar 04 '19 11:03 i-like-robots

I gave a quick look at importing o-ads using npm on n-ui here: https://github.com/Financial-Times/n-ui/pull/1381 . It seems to work fine and I was thinking of merging after doing some more manual testing (automated tests are passing).

@chee @i-like-robots Based on your recommendation, I'm going to close it unless you see any value in not doing so.

carlesandres avatar Mar 04 '19 13:03 carlesandres

@carlesandres i've replied on that thread, but to reiterate the important point here:

Using Origami simulatneously through both bower and npm is not recommended and is completely unsupported.

It will result in multiple copies of the same package in the bundle, unpredictable sass imports, confusing errors.

We are not ready.

chee avatar Mar 04 '19 15:03 chee

@chee @i-like-robots I would love to ditch Bower. I do believe it's old tech, it served well for a while and it still does but having it in all our repos in conjunction with npm it seems a useless burden to maintain and add additional complexity to all our codebases.

...psst! While Bower is maintained, we recommend using Yarn and Webpack or Parcel for front-end projects...

Maybe time is ripe now 🤷‍♂

umbobabo avatar Feb 26 '20 17:02 umbobabo

I'm just jumping in here to agree with the very keen to ditch Bower statement. With the current infrastructure, it just makes dependency management a pain.

remybach avatar Mar 03 '20 15:03 remybach

Given the comment on the bower's npm page (the one encouraging people to use yarn etc), I think we will need to ditch Bower sooner or later. Unless there are plans to move away from PageKit, this should be on the roadmap.

Furthermore, with durable teams, some teams are finding themselves with a large number of repos to look after and not that many people to maintain them. Moving to npm would make this easier long term.

AniaMakes avatar Mar 03 '20 17:03 AniaMakes