flems.io icon indicating copy to clipboard operation
flems.io copied to clipboard

Looks like the `flems.io/react` fails to resolve unpkg pkg

Open cmnstmntmn opened this issue 5 months ago • 10 comments

Hei,

While trying to generate a react playground with flems.io/react I'm getting:

Error loading:
	https://unpkg.com/react/umd/react.development.js

However looks like https://unpkg.com/react redirects to the latest version https://unpkg.com/[email protected]/index.js

I also tried to add the react dependency manually, but is not working either.

cmnstmntmn avatar Jul 11 '25 21:07 cmnstmntmn

Looks like for react v19, there's no umd builds

I was able to manually create a playground in v18

cmnstmntmn avatar Jul 11 '25 21:07 cmnstmntmn

React?? Why are you hurting yourself? 😅

I guess this also works

porsager avatar Jul 11 '25 21:07 porsager

ty @porsager .. well i just have to prepare some examples for work (legacy code/old mentalities)

cmnstmntmn avatar Jul 12 '25 10:07 cmnstmntmn

@porsager how can the compiler type can be specified from the outside (eg. a gist)

I was looking to create a state.files file inside the gist; but doesn't seem to work.

https://gist.github.com/cmnstmntmn/a96aeb7875ff582cee6ee18000a2077a

cmnstmntmn avatar Jul 12 '25 22:07 cmnstmntmn

It just goes by the extension, so if you name it .js instead of .files it should be good

porsager avatar Jul 12 '25 23:07 porsager

Oh sorry - now I see, you want to supply the flems state object... Theres no support in gists for that. Maybe if we make support for a special flems.json file?

porsager avatar Jul 12 '25 23:07 porsager

Maybe you're better off just saving the flems url directly in a gist if you need a shorter url?

porsager avatar Jul 12 '25 23:07 porsager

@porsager yeap, having a flems.json to pass configs from the outside would be a nice addition. the goal was to keep gist as an entry point and have https://flems.io/GIST_URL pined in the docs.

cmnstmntmn avatar Jul 12 '25 23:07 cmnstmntmn

Ah ok - why not embed flems directly in the docs?

porsager avatar Jul 12 '25 23:07 porsager

Maybe you're better off just saving the flems url directly in a gist if you need a shorter url?

that'll work for now, but i'll have to do two updates with each code change in two different places:

  • code update (flems side)
  • update doc (new flems url) to reflect the changes

cmnstmntmn avatar Jul 12 '25 23:07 cmnstmntmn