boywithkeyboard-archive / cheetah1

A framework for the modern web. (NO LONGER MAINTAINED)
https://cheetah.mod.land
Apache License 2.0
192 stars 1 forks source link

feat(render): dynamic head content #213

Closed jaymanmdev closed 1 year ago

jaymanmdev commented 1 year ago

update the JSX render class to not explicitly inject HTML inside of the body tag, allowing for head meta tags and such to be injected and handled by the browser.

boywithkeyboard commented 1 year ago

@jaymanmdev seems like the test suite failed because of the changes you made. Please read the test file and try to fix the issue.

boywithkeyboard commented 1 year ago

Other than that, I like the idea behind this pr! :)

jaymanmdev commented 1 year ago

Sorry, this is my first ever PR in any repo so I am still getting the hang of it, I'm getting in the habit of running the tests before submitting an adjustment to my PR/s from now on. Thanks!

Edit: I can merge the two render tests together later on if that would be preferred. :)

boywithkeyboard commented 1 year ago

image

Our contributing guidelines are really basic but that's the one thing that's included in them. 😅

jaymanmdev commented 1 year ago

image

Our contributing guidelines are really basic but that's the one thing that's included in them. 😅

Ah, I didn't pick up on that guidelines file - my bad! I tested the suite this time though.

boywithkeyboard commented 1 year ago

Just make a sub-test, e.g.

Deno.test('something', async (t) => {
  await t.step('first step', async () => {
    // some code
  })
})
jaymanmdev commented 1 year ago

Just make a sub-test, e.g.

Deno.test('something', async (t) => {
  await t.step('first step', async () => {
    // some code
  })
})

I'll quickly do this now, and submit an adjustment.

jaymanmdev commented 1 year ago

b1341059dd16ef47954ad1c94e865c41c836a73e

Let me know what you think.

  1. I removed the head manipulation that I was doing as the browser knows where to put specific tags, unless specifically stated otherwise (e.g. putting a meta tag inside the body tag.). We can build out better sanitization of the HTML later on if you'd like?
  2. I added a new test case to test this.