sprotty icon indicating copy to clipboard operation
sprotty copied to clipboard

Use generate codicon.css with embedded TTF instead of imported one

Open kaisalmen opened this issue 3 years ago • 2 comments

  • This removes the need to have codicon as depedency to the sprotty core
  • Replace rimraf wih shx along the way

This is the proposed solution for #311

kaisalmen avatar Sep 09 '22 16:09 kaisalmen

This brings up a more general question to me regarding the original introduction of the codicons dependency in #249: Shouldn't this be a dependency of the concrete application or downstream library rather than the core package? The sprotty package itself does not need this dependency, only the applications that want to include such icons do. A lot of users of the sprotty package do not need codicons. Would it be feasible to drop the dependency and leave it to the responsibility of the package users to bundle the icons if they need them?

In general, I agree this probably should be a dependency of the downstream project. This way the consuming project/library could is also in complete control of the codicon version that should be used.

The sprotty package itself does not need this dependency, only the applications that want to include such icons do.

That's currently not completely true. It seems like default implementation of the command palette is currently using codicons. So we should probably refactor this or at least mention in the ts doc that codicon is needed for the command palette feature.

tortmayr avatar Sep 12 '22 07:09 tortmayr

@tortmayr @planger so shall we work towards getting rid of the codicons dependency in the core package? Of course this needs to be well documented in the CHANGELOG, but it sounds viable to me.

spoenemann avatar Sep 15 '22 07:09 spoenemann

@tortmayr ping

spoenemann avatar Nov 22 '22 10:11 spoenemann

I have squashed and force pushed the branch on current main and performed a bit of clean-up.

We could use this workaround/solution for now until we find a potential better solution. It would help prevent for example this problem: https://github.com/eclipse/sprotty/issues/311#issuecomment-1323416308

kaisalmen avatar Nov 28 '22 09:11 kaisalmen

Ok, in addition I will apply add the codicon css to the classdiagram example. Then it it is not only documented, but people can see how it is actually done (we can even reference that from the CHANGELOG).

kaisalmen avatar Nov 29 '22 09:11 kaisalmen

@spoenemann Sorry for the late reply. The proposed changes look good to me 👍🏼

tortmayr avatar Nov 29 '22 09:11 tortmayr

@spoenemann The rework is done. This is now ready for review. I fought with the webpack config, beacuse codicon.ttf was not loaded. In the end, removing the extra config removed the problem. webpack 5 (introduced in between initial addition of command palette) changed asset handling.

kaisalmen avatar Dec 05 '22 11:12 kaisalmen