Giter VIP home page Giter VIP logo

Comments (3)

joerdav avatar joerdav commented on September 15, 2024 1

Hi @garrettladley thanks for the error report. This is expected as some of the imports being "magic" was causing a few issues and confusion, as well as making some logic a bit more complicated than it needed to be, so we have removed any standard library packages from being "magically" imported to templ files.

I expect that the reason you are seeing an error in the LSP is that the templ binary that is being used as an LSP is different to the one you are using for templ generate.

But in short yes, this is expected.

from templ.

joerdav avatar joerdav commented on September 15, 2024 1

It was in the last release https://github.com/a-h/templ/releases/tag/v0.2.731 here's the commit: #793

It's maybe not obvious the side effects of this change, but since the formatter should fix any issues we accepted the risk.

Absolutely happy to take a PR for clarifying the docs too :)

from templ.

garrettladley avatar garrettladley commented on September 15, 2024

Hey @joerdav, thanks for getting back to me! Just for my understanding, when was this change made? I don't see anything mentioning context or imports in any of the recent changelogs. Also, I checked the docs before opening this issue and they didn't mention this change/new feature. The below linked pages about context still suggest using the implicit ctx. I'd be happy to raise a PR with the update.

templ.guide page
md doc

from templ.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.