Bhardwajspeaks wrote a brilliant thread on twitter where he debunked the myth that bursting firecrackers is a new innovation that was recently introduced into deepavali festivities. It went on to show that bursting firecrackers has always been intergral and central part of Deepavali.
Here is the thread-

At the very core of this entire MYTH is the presumption that Gunpowder (cf. fireworks) was invented in China in 9th century and brought to India by Muslim rulers.This THREAD debunks this widespread MYTH and throws light on the unknown/hidden history of dīpāvali & gunpowder.Indeed, so widespread is this myth that gunpowder is popularly known as one of “ the “Four Great Inventions” of China”.However, this myth starts falling apart when we examine Chinese sources themselves for the origin of Gunpowder. According to Chinese sources themselves, an Indian Buddhist monk who brought gunpowder technology to China. In 664 CE, he discovered soils in China containing Saltpetre (primary constituent of gunpowder).Chinese studies of Chemistry of saltpetre show evidence of Indian origin.

Of course, this is not to say that Chinese have no contribution to Gunpowder technology. They improvised it & made innovations. However, the initial knowledge of Gunpowder came to China from India.Even Scholar Roger Pauly, a hardcore Sinophile, admits “Indian inspiration”.

For those familiar with Indian literature, this should hardly come as a surprise. Indian literature contains ample references to what could be seen as an early form of Gunpowder.Let us examine these references before jumping into the discussion about Dipavali.

Vaisampayana, the narrator of Mahabharata, describes the manufacture of smoke balls by ancient Indians using what many scholars see as Gunpowder. According to a medieval commentator of the verse, the aforementioned smoke balls were indeed made of Gunpowder.

Atharvanarahasya mentions the use of charcoal, sulphur and saltpetre to make gunpowder, which are the same ingredients used even today to manufacture Gunpowder. In-fact, workers at Sivakasi use these ingredients to make fireworks even today (more below).

A look at how Diwali fireworks are manufactured by traditional makers to this day is very revealing. We must see how  traditional maker of fireworks from Andhra in action.This is a simple form of crackers but use of such crackers is very widespread.In the above video, the Andhra maker uses basic ingredients to make simple fireworks.
1. Suryakara (सूर्यकार, Telugu సురేకారము)= Saltpetre
2. Gandhaka(गन्धक, గంధకము)= Sulphur.
3. Sand.
These  were known in India since ancient age . Why would Indians borrow this from anywhere?
The etymology of the ingredients tells us about their origin.

The Indian firecracker workers of Andhra and Sivakasi use the Indic Saltpetre (सूर्यकार) whose origin is Sanskritic. They do not use the word Shora (शोरा شورہ) which is Persian for Saltpetre  imported in medieval age
It takes an extremely colonized mindset to claim that Indians were incapable of making simple fireworks themselves when they had all basic ingredients since antiquity.

Did they have to wait for Muslims to come and teach them to put all these ingredients in a container?Uptil this point, we have seen that Indians had knowledge about use of Saltpetre/gunpowder & were perfectly capable of making fireworks themselves. Now we shall come to Diwali. Why are fireworks used in Diwali? What is the underlying theology? These will be discussed further
At the core of Dipavali is a belief  that our departed ancestors would come back on this night.It is believed that on the night of Chaturdashi & Amavasya, the Pitrs would come back.It is the light & noise which shows them the path in the dark. Hence we illuminate our houses.The Skanda Purāṇa is largest of the 18 MahāPurāṇas.
It describes the rites to be performed on Dīpāvalī and it mentions this belief.The Vaiṣṇava-khaṇḍa of Skanda Purāṇa says
उल्काहस्ता नराः कुर्युः पितॄणां मार्गदर्शनम्।
नरकस्थास्तु ये प्रेतास्ते मार्गं तु व्रतात्सदा ।।

The Skanda Purana says Diwali should be celebrated by holding Ulkas in our hands. This will show path to our ancestors.What are “Ulkas”? The meaning of this word has changed with time. GV Tagare translates it as “firebrands”.[Firecrackers in their early form were firebrands]

Analysing such verses, professor of Sanskrit and historian Dr. GV Raghavan concludes that (an early form of) crackers have been a part of Dipavali celebrations since earliest times.He says that their religious purpose was to illuminate & resonate  the path of departed pitrs.

In her thesis, Indologist Tracy Pintchman  says that the core of Diwali festivity is illuminating the path of deceased ancestors with firecrackers and lights.

This is also corroborated in Ananda Ramayana. Ananda Ramayana is an epic that has been traditionally been attributed to Valmiki. It mentions that fireworks were burst during Lord Rama’s homecoming.It mentions crackers which burst and shine in the sky (gaganantarvirajitan).As against this, it is objected that Ananda Rāmāyaṇa is a work of 15th century.But these dates have been assigned by same Indologists who assigned a date of 500-100 BC (post Buddha) for Valmiki Rāmāyaṇa. Clearly, this is at odds with tradition which puts both in Treta Yuga

In Hinduism,date doesn’t determine validity.
What does is acceptance of texts among Sampradayas . Ananda Ramayana easily qualifies such test and is accepted by most Sampradayas.”This practice isn’t old enough,ban it” is Abrahamic.This isnt really how Hindu tradition operatesSuch an idea could be seen in Medhātithi’s 11th century commentary on Manusmriti 2.6.He says that a practice (in our case bursting firecrackers), what is actually done with a view to invisible results, by persons learned in the Veda has the authority of Smriti.

Hard archaeological  evidence for all festivals has been allusive in a tropical & frequently (re)populated civilization like India.These are wall murals(of a possibly later date) on 9th century Tyagaraja temple in Tamilnadu. They depict festival celebrations with firecrackers.

DISCLAIMER: The author is solely responsible for the views expressed in this article. The author carries the responsibility for citing and/or licensing of images utilized within the text.